Skip to content
Permalink
Browse files

feat(all): use core-js v3 to replace deprecated @babel/polyfill

Reference: https://github.com/zloirock/core-js#babelpolyfill
https://babeljs.io/blog/2019/03/19/7.4.0#migration-from-core-js-2
This migration is necessary to keep future cli-bundler built working as @babel/polyfill will stay at core-js v2 which could cause potiential version conflicts with core-js v3.
  • Loading branch information...
huochunpeng committed Mar 24, 2019
1 parent dc14e4b commit 990af96bc357fe3432b308ae3ee32ffca41a9ec2
@@ -16,20 +16,20 @@
"aurelia-webpack-plugin": "^3.0.0",
"aurelia-polyfills": "^1.3.3",
"autoprefixer": "^9.4.8",
"@babel/core": "^7.3.3",
"@babel/core": "^7.4.0",
"babel-eslint": "^10.0.1",
"babel-jest": "^24.1.0",
"babel-loader": "^8.0.4",
"babel-plugin-istanbul": "^5.1.0",
"@babel/plugin-proposal-decorators": "^7.3.0",
"@babel/plugin-proposal-class-properties": "^7.3.3",
"@babel/polyfill": "^7.2.5",
"@babel/preset-env": "^7.3.1",
"@babel/register": "^7.0.0",
"babel-jest": "^24.5.0",
"babel-loader": "^8.0.5",
"babel-plugin-istanbul": "^5.1.1",
"@babel/plugin-proposal-decorators": "^7.4.0",
"@babel/plugin-proposal-class-properties": "^7.4.0",
"@babel/preset-env": "^7.4.2",
"@babel/register": "^7.4.0",
"browser-sync": "^2.26.3",
"clean-webpack-plugin": "^1.0.1",
"connect-history-api-fallback": "^1.6.0",
"copy-webpack-plugin": "^5.0.0",
"core-js": "^3.0.0",
"cross-env": "^5.2.0",
"cssnano": "^4.1.10",
"css-loader": "^1.0.0",
@@ -69,7 +69,7 @@
"json-loader": "^0.5.7",
"html-loader": "^0.5.5",
"karma": "^3.0.0",
"karma-babel-preprocessor": "^8.0.0-beta.0",
"karma-babel-preprocessor": "^8.0.0",
"karma-chrome-launcher": "^2.2.0",
"karma-coverage-istanbul-reporter": "^2.0.4",
"karma-jasmine": "^2.0.1",
@@ -83,6 +83,7 @@
"postcss-loader": "^3.0.0",
"postcss-url": "^8.0.0",
"protractor": "^5.4.2",
"regenerator-runtime": "0.13.2",
"requirejs": "^2.3.6",
"sass-loader": "^7.1.0",
"style-loader": "^0.23.1",
@@ -104,7 +104,6 @@ function getMetadata(dir) {
}

function installBabel() {
require('@babel/polyfill');
require('@babel/register')({
babelrc: false,
plugins: [
@@ -20,7 +20,6 @@
"@babel/plugin-proposal-class-properties": "",
"@babel/preset-env": "",
"@babel/core": "",
"@babel/polyfill": "",
"@babel/register": "",
"gulp-babel": "",
"gulp-cache": "",
@@ -15,10 +15,15 @@
"aurelia-cli": "",
"aurelia-testing": "",
"aurelia-tools": "",
"core-js": "",
"gulp": "",
"minimatch": "",
"through2": "",
"vinyl-fs": ""
"vinyl-fs": "",

// @if feat.babel
"regenerator-runtime": "",
// @endif
},
"scripts": {
"build": "au build",
@@ -58,7 +58,6 @@ exports.config = {
// @if feat.babel
process.env.BABEL_TARGET = 'node';
process.env.IN_PROTRACTOR = 'true';
require('@babel/polyfill');
require('@babel/register');
// @endif
// @if feat.typescript
@@ -1,4 +1,7 @@
import '@babel/polyfill';
import 'core-js/stable';
// @if feat.babel
import 'regenerator-runtime/runtime';
// @endif
// @if feat.typescript
import {Aurelia} from 'aurelia-framework'
// @endif
@@ -1,4 +1,7 @@
import '@babel/polyfill';
import 'core-js/stable';
// @if feat.babel
import 'regenerator-runtime/runtime';
// @endif
import 'bootstrap';
// @if feat.typescript
import {Aurelia} from 'aurelia-framework';
@@ -14,7 +14,6 @@
"@babel/plugin-proposal-class-properties": "",
"@babel/preset-env": "",
"@babel/core": "",
"@babel/polyfill": "",
"@babel/register": "",
// @endif

0 comments on commit 990af96

Please sign in to comment.
You can’t perform that action at this time.