Skip to content

Commit 094920a

Browse files
committed
feat($build): Replace babel presets with babel-preset-env and upgrade webpack-dev-server
1 parent cb5deec commit 094920a

File tree

4 files changed

+293
-285
lines changed

4 files changed

+293
-285
lines changed

config/webpack.config.dev.js

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,24 @@ module.exports = {
7474
exclude: [/elm-stuff/, /node_modules/],
7575
loader: require.resolve('babel-loader'),
7676
query: {
77+
// Latest stable ECMAScript features
7778
presets: [
78-
require.resolve('babel-preset-es2015'),
79-
require.resolve('babel-preset-es2016'),
80-
require.resolve('babel-preset-es2017')
79+
[
80+
require.resolve('babel-preset-env'),
81+
{
82+
targets: {
83+
// React parses on ie 9, so we should too
84+
ie: 9,
85+
// We currently minify with uglify
86+
// Remove after https://github.com/mishoo/UglifyJS2/issues/448
87+
uglify: true
88+
},
89+
// Disable polyfill transforms
90+
useBuiltIns: false,
91+
// Do not transform modules to CJS
92+
modules: false
93+
}
94+
]
8195
]
8296
}
8397
},

config/webpack.config.prod.js

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,24 @@ module.exports = {
7171
exclude: [/elm-stuff/, /node_modules/],
7272
loader: require.resolve('babel-loader'),
7373
query: {
74+
// Latest stable ECMAScript features
7475
presets: [
75-
require.resolve('babel-preset-es2015'),
76-
require.resolve('babel-preset-es2016'),
77-
require.resolve('babel-preset-es2017')
76+
[
77+
require.resolve('babel-preset-env'),
78+
{
79+
targets: {
80+
// React parses on ie 9, so we should too
81+
ie: 9,
82+
// We currently minify with uglify
83+
// Remove after https://github.com/mishoo/UglifyJS2/issues/448
84+
uglify: true
85+
},
86+
// Disable polyfill transforms
87+
useBuiltIns: false,
88+
// Do not transform modules to CJS
89+
modules: false
90+
}
91+
]
7892
]
7993
}
8094
},

package.json

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@
2222
"babel-cli": "^6.26.0",
2323
"babel-core": "^6.26.0",
2424
"babel-loader": "^7.1.2",
25-
"babel-preset-es2015": "^6.24.1",
26-
"babel-preset-es2016": "^6.24.1",
27-
"babel-preset-es2017": "^6.24.1",
25+
"babel-preset-env": "^1.6.0",
2826
"chalk": "^2.1.0",
2927
"clean-webpack-plugin": "^0.1.16",
3028
"cli-table": "0.3.1",
@@ -51,10 +49,10 @@
5149
"sw-precache-webpack-plugin": "^0.11.4",
5250
"url-loader": "^0.5.9",
5351
"webpack": "^3.5.6",
54-
"webpack-dev-server": "^2.7.1"
52+
"webpack-dev-server": "^2.8.1"
5553
},
5654
"devDependencies": {
57-
"babel-eslint": "^7.2.3",
55+
"babel-eslint": "^8.0.0",
5856
"commitizen": "^2.9.6",
5957
"cz-conventional-changelog": "^2.0.0",
6058
"dir-compare": "^1.3.0",
@@ -63,7 +61,7 @@
6361
"husky": "^0.14.3",
6462
"mocha": "^3.5.2",
6563
"nightmare": "^2.10.0",
66-
"prettier": "^1.6.1",
64+
"prettier": "^1.7.0",
6765
"rimraf": "^2.5.4",
6866
"semantic-release": "^7.0.2",
6967
"unexpected": "^10.35.0"
@@ -94,7 +92,7 @@
9492
"prettier": "prettier --write --single-quote '{bin,config,scripts,template/src,tests}/**/*.js'",
9593
"semantic-release": "semantic-release pre && npm publish && semantic-release post",
9694
"test": "npm run test:cli && npm run test:functional",
97-
"test:cli": "mocha tests/cliAccessibility.js --timeout 15000",
98-
"test:functional": "mocha tests/*.spec.js --timeout 15000"
95+
"test:cli": "mocha tests/cliAccessibility.js --reporter spec --timeout 15000",
96+
"test:functional": "mocha tests/*.spec.js --reporter spec --timeout 15000"
9997
}
10098
}

0 commit comments

Comments
 (0)