Skip to content
This repository was archived by the owner on Mar 22, 2020. It is now read-only.

Commit 55fad53

Browse files
committed
Update dependencies; Remove buggy webpack-image-loader;
1 parent e20fada commit 55fad53

9 files changed

+9299
-17283
lines changed

.babelrc

Lines changed: 0 additions & 25 deletions
This file was deleted.

app/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
// Needed for redux-saga es6 generator support
9-
import 'babel-polyfill';
9+
import '@babel/polyfill';
1010

1111
// Import all the third party stuff
1212
import React from 'react';

babel.config.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
module.exports = {
2+
presets: [
3+
[
4+
'@babel/preset-env',
5+
{
6+
modules: false
7+
}
8+
],
9+
'@babel/preset-react'
10+
],
11+
plugins: ['@babel/plugin-proposal-class-properties', '@babel/plugin-syntax-dynamic-import'],
12+
env: {
13+
production: {
14+
only: ['app'],
15+
plugins: [
16+
'lodash',
17+
'transform-react-remove-prop-types',
18+
'@babel/plugin-transform-react-inline-elements',
19+
'@babel/plugin-transform-react-constant-elements'
20+
]
21+
},
22+
test: {
23+
plugins: ['@babel/plugin-transform-modules-commonjs', 'dynamic-import-node']
24+
}
25+
}
26+
};

config/jest.config.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@ module.exports = {
1616
},
1717
coverageReporters: ['json', 'lcov', 'text-summary'],
1818
moduleDirectories: ['node_modules', 'app'],
19+
transform: {
20+
'^.+\\.(js|jsx)$': '<rootDir>/node_modules/babel-jest'
21+
},
22+
transformIgnorePatterns: ['[/\\\\]node_modules[/\\\\].+\\.(js|jsx)$', '^.+\\.module\\.(css|sass|scss)$'],
1923
moduleNameMapper: {
20-
'.*\\.(css|less|styl|scss|sass)$':
21-
'<rootDir>/config/jest-mocks/cssModule.js',
24+
'.*\\.(css|less|styl|scss|sass)$': '<rootDir>/config/jest-mocks/cssModule.js',
2225
'.*\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
2326
'<rootDir>/config/jest-mocks/image.js'
2427
},

config/test-setup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// needed for regenerator-runtime
22
// (ES7 generator support is required by redux-saga)
3-
import 'babel-polyfill';
3+
import '@babel/polyfill';
44

55
// Enzyme adapter for React 16
66
import Enzyme from 'enzyme';

config/webpack.base.babel.js

Lines changed: 21 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -10,61 +10,43 @@ process.noDeprecation = true;
1010
module.exports = (options) => ({
1111
mode: options.mode,
1212
entry: options.entry,
13-
output: Object.assign({ // Compile into js/build.js
14-
path: path.resolve(process.cwd(), 'build'),
15-
publicPath: '/',
16-
}, options.output), // Merge with env dependent settings
13+
output: Object.assign(
14+
{
15+
// Compile into js/build.js
16+
path: path.resolve(process.cwd(), 'build'),
17+
publicPath: '/'
18+
},
19+
options.output
20+
), // Merge with env dependent settings
1721
module: {
1822
rules: [
1923
{
2024
test: /\.js$/, // Transform all .js files required somewhere with Babel
2125
exclude: /node_modules/,
2226
use: {
2327
loader: 'babel-loader',
24-
options: options.babelQuery,
25-
},
28+
options: options.babelQuery
29+
}
2630
},
2731
{
2832
// Preprocess our own .scss files
2933
test: /\.scss$/,
3034
exclude: /node_modules/,
31-
use: ['style-loader', 'css-loader', 'sass-loader'],
35+
use: ['style-loader', 'css-loader', 'sass-loader']
3236
},
3337
{
3438
// Preprocess 3rd party .css files located in node_modules
3539
test: /\.css$/,
3640
include: /node_modules/,
37-
use: ['style-loader', 'css-loader'],
41+
use: ['style-loader', 'css-loader']
3842
},
3943
{
4044
test: /\.(eot|svg|otf|ttf|woff|woff2)$/,
41-
use: 'file-loader',
45+
use: 'file-loader'
4246
},
4347
{
4448
test: /\.(jpg|png|gif)$/,
45-
use: [
46-
'file-loader',
47-
{
48-
loader: 'image-webpack-loader',
49-
options: {
50-
query: {
51-
gifsicle: {
52-
interlaced: true
53-
},
54-
mozjpeg: {
55-
progressive: true
56-
},
57-
optipng: {
58-
optimizationLevel: 7
59-
},
60-
pngquant: {
61-
quality: '65-90',
62-
speed: 4
63-
}
64-
}
65-
},
66-
},
67-
],
49+
use: 'file-loader'
6850
},
6951
{
7052
test: /\.html$/,
@@ -76,10 +58,10 @@ module.exports = (options) => ({
7658
loader: 'url-loader',
7759
options: {
7860
limit: 10000
79-
},
80-
},
81-
},
82-
],
61+
}
62+
}
63+
}
64+
]
8365
},
8466
plugins: options.plugins.concat([
8567
new webpack.ProvidePlugin({
@@ -93,22 +75,13 @@ module.exports = (options) => ({
9375
new webpack.DefinePlugin({
9476
'process.env': {
9577
NODE_ENV: JSON.stringify(process.env.NODE_ENV)
96-
},
78+
}
9779
})
9880
]),
9981
resolve: {
10082
modules: ['app', 'node_modules'],
101-
extensions: [
102-
'.js',
103-
'.jsx',
104-
'.scss',
105-
'.react.js'
106-
],
107-
mainFields: [
108-
'browser',
109-
'jsnext:main',
110-
'main'
111-
]
83+
extensions: ['.js', '.jsx', '.scss', '.react.js'],
84+
mainFields: ['browser', 'jsnext:main', 'main']
11285
},
11386
devtool: options.devtool,
11487
target: 'web', // Make web variables accessible to webpack, e.g. window

0 commit comments

Comments
 (0)