Permalink
Browse files

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
  • Loading branch information...
huochunpeng committed Jul 29, 2018
1 parent e9c5b2f commit 1afe47f19e4710a5591986e94085ab209176c83a
@@ -10,6 +10,7 @@ module.exports = function(project) {
project.addToContent(
ProjectItem.resource('.eslintrc.json', 'content/eslintrc.json'),
ProjectItem.resource('.babelrc.js', 'content/babelrc.js'),
ProjectItem.resource('.babelrc', 'content/babelrc')
).addToTasks(
ProjectItem.resource('transpile.js', 'tasks/transpile.js'),
@@ -18,10 +19,8 @@ module.exports = function(project) {
'babel-eslint',
'babel-plugin-syntax-flow',
'babel-plugin-transform-decorators-legacy',
'babel-plugin-transform-es2015-modules-amd',
'babel-plugin-transform-es2015-modules-commonjs',
'babel-plugin-transform-flow-strip-types',
'babel-preset-es2015',
'babel-preset-env',
'babel-preset-stage-1',
'babel-polyfill',
'babel-register',
@@ -10,20 +10,18 @@ module.exports = function(project) {
project.addToContent(
ProjectItem.resource('.eslintrc.json', 'content/eslintrc.json'),
ProjectItem.resource('.babelrc.js', 'content/babelrc.webpack.js'),
ProjectItem.resource('.babelrc', 'content/babelrc.webpack')
ProjectItem.resource('.babelrc.js', 'content/babelrc.js'),
ProjectItem.resource('.babelrc', 'content/babelrc')
).addToDevDependencies(
'babel-eslint@7.2.3',
'eslint@3.19.0',
'babel-loader',
'babel-core',
'babel-plugin-syntax-flow',
'babel-plugin-transform-class-properties',
'babel-plugin-transform-decorators-legacy',
'babel-plugin-transform-flow-strip-types',
'babel-polyfill',
'babel-preset-env',
'babel-preset-es2015',
'babel-preset-stage-1',
'babel-register',
'babel-plugin-istanbul'
@@ -22,14 +22,10 @@
"babel-loader": "^7.1.4",
"babel-plugin-istanbul": "^4.1.5",
"babel-plugin-syntax-flow": "^6.18.0",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-es2015-modules-amd": "^6.24.1",
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.0",
"babel-plugin-transform-flow-strip-types": "^6.22.0",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.6.1",
"babel-preset-es2015": "^6.24.1",
"babel-preset-stage-1": "^6.24.1",
"babel-register": "^6.26.0",
"bluebird": "^3.5.1",
@@ -1,17 +1,5 @@
{
"sourceMap": true,
"sourceRoot": "src",
"moduleIds": false,
"comments": false,
"compact": false,
"code": true,
"presets": [
["es2015", {"loose": true}],
"stage-1"
],
"plugins": [
"syntax-flow",
"transform-decorators-legacy",
"transform-flow-strip-types"
"./.babelrc.js"
]
}
}
@@ -2,26 +2,23 @@
module.exports = () => {
return {
"plugins": [
"syntax-flow",
"transform-decorators-legacy",
"transform-class-properties"
"transform-flow-strip-types"
],
"presets": [
[
"env", {
"targets": process.env.BABEL_TARGET === 'node' ? {
"node": process.env.IN_PROTRACTOR ? '6' : 'current'
} : {
"browsers": [
"last 2 versions",
"not ie <= 11"
],
"uglify": process.env.NODE_ENV === 'production',
"browsers": [ "last 2 versions" ]
},
"loose": true,
"modules": process.env.BABEL_TARGET === 'node' ? 'commonjs' : false,
"useBuiltIns": true
"modules": process.env.BABEL_TARGET === 'node' ? 'commonjs' : false
}
]
],
"stage-1"
]
}
}
}

This file was deleted.

Oops, something went wrong.
@@ -1,6 +1,5 @@
import environment from './environment';
import {PLATFORM} from 'aurelia-pal';
import 'babel-polyfill';
import * as Bluebird from 'bluebird';
// remove out if you don't want a Promise polyfill (remove also from webpack.config.js)

0 comments on commit 1afe47f

Please sign in to comment.