Skip to content

Commit 1afe47f

Browse files
committed
feat: upgrade to babel-preset-env
Unify babelrc for webpack and cli bundler. Cleaned up webpack babelrc to use same plugins as other setup. Add IE10/11 support back to webpack setup as that is what Aurelia claimed to support. closes #754, #909
1 parent e9c5b2f commit 1afe47f

File tree

7 files changed

+13
-41
lines changed

7 files changed

+13
-41
lines changed

lib/commands/new/buildsystems/cli/transpilers/babel.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ module.exports = function(project) {
1010

1111
project.addToContent(
1212
ProjectItem.resource('.eslintrc.json', 'content/eslintrc.json'),
13+
ProjectItem.resource('.babelrc.js', 'content/babelrc.js'),
1314
ProjectItem.resource('.babelrc', 'content/babelrc')
1415
).addToTasks(
1516
ProjectItem.resource('transpile.js', 'tasks/transpile.js'),
@@ -18,10 +19,8 @@ module.exports = function(project) {
1819
'babel-eslint',
1920
'babel-plugin-syntax-flow',
2021
'babel-plugin-transform-decorators-legacy',
21-
'babel-plugin-transform-es2015-modules-amd',
22-
'babel-plugin-transform-es2015-modules-commonjs',
2322
'babel-plugin-transform-flow-strip-types',
24-
'babel-preset-es2015',
23+
'babel-preset-env',
2524
'babel-preset-stage-1',
2625
'babel-polyfill',
2726
'babel-register',

lib/commands/new/buildsystems/webpack/transpilers/babel.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,18 @@ module.exports = function(project) {
1010

1111
project.addToContent(
1212
ProjectItem.resource('.eslintrc.json', 'content/eslintrc.json'),
13-
ProjectItem.resource('.babelrc.js', 'content/babelrc.webpack.js'),
14-
ProjectItem.resource('.babelrc', 'content/babelrc.webpack')
13+
ProjectItem.resource('.babelrc.js', 'content/babelrc.js'),
14+
ProjectItem.resource('.babelrc', 'content/babelrc')
1515
).addToDevDependencies(
1616
'babel-eslint@7.2.3',
1717
'eslint@3.19.0',
1818
'babel-loader',
1919
'babel-core',
2020
'babel-plugin-syntax-flow',
21-
'babel-plugin-transform-class-properties',
2221
'babel-plugin-transform-decorators-legacy',
2322
'babel-plugin-transform-flow-strip-types',
2423
'babel-polyfill',
2524
'babel-preset-env',
26-
'babel-preset-es2015',
2725
'babel-preset-stage-1',
2826
'babel-register',
2927
'babel-plugin-istanbul'

lib/dependencies.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,10 @@
2222
"babel-loader": "^7.1.4",
2323
"babel-plugin-istanbul": "^4.1.5",
2424
"babel-plugin-syntax-flow": "^6.18.0",
25-
"babel-plugin-transform-class-properties": "^6.24.1",
2625
"babel-plugin-transform-decorators-legacy": "^1.3.4",
27-
"babel-plugin-transform-es2015-modules-amd": "^6.24.1",
28-
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.0",
2926
"babel-plugin-transform-flow-strip-types": "^6.22.0",
3027
"babel-polyfill": "^6.26.0",
3128
"babel-preset-env": "^1.6.1",
32-
"babel-preset-es2015": "^6.24.1",
3329
"babel-preset-stage-1": "^6.24.1",
3430
"babel-register": "^6.26.0",
3531
"bluebird": "^3.5.1",

lib/resources/content/babelrc

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
11
{
2-
"sourceMap": true,
3-
"sourceRoot": "src",
4-
"moduleIds": false,
5-
"comments": false,
6-
"compact": false,
7-
"code": true,
82
"presets": [
9-
["es2015", {"loose": true}],
10-
"stage-1"
11-
],
12-
"plugins": [
13-
"syntax-flow",
14-
"transform-decorators-legacy",
15-
"transform-flow-strip-types"
3+
"./.babelrc.js"
164
]
17-
}
5+
}
Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,23 @@
22
module.exports = () => {
33
return {
44
"plugins": [
5+
"syntax-flow",
56
"transform-decorators-legacy",
6-
"transform-class-properties"
7+
"transform-flow-strip-types"
78
],
89
"presets": [
910
[
1011
"env", {
1112
"targets": process.env.BABEL_TARGET === 'node' ? {
1213
"node": process.env.IN_PROTRACTOR ? '6' : 'current'
1314
} : {
14-
"browsers": [
15-
"last 2 versions",
16-
"not ie <= 11"
17-
],
18-
"uglify": process.env.NODE_ENV === 'production',
15+
"browsers": [ "last 2 versions" ]
1916
},
2017
"loose": true,
21-
"modules": process.env.BABEL_TARGET === 'node' ? 'commonjs' : false,
22-
"useBuiltIns": true
18+
"modules": process.env.BABEL_TARGET === 'node' ? 'commonjs' : false
2319
}
24-
]
20+
],
21+
"stage-1"
2522
]
2623
}
27-
}
24+
}

lib/resources/content/babelrc.webpack

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

lib/resources/src/main-webpack.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import environment from './environment';
22
import {PLATFORM} from 'aurelia-pal';
3-
import 'babel-polyfill';
43
import * as Bluebird from 'bluebird';
54

65
// remove out if you don't want a Promise polyfill (remove also from webpack.config.js)

0 commit comments

Comments
 (0)