hotfix: revert to corejs@2 (#5317)

This commit is contained in:
Pooya Parsa 2019-03-21 22:59:51 +03:30 committed by Xin Du (Clark)
parent af115b323d
commit 20836d9341
8 changed files with 21 additions and 30 deletions

View File

@ -1,16 +1,19 @@
#!/usr/bin/env node #!/usr/bin/env node
require('core-js/stable') require('core-js')
require('renegerator-runtime/runtime') require('regenerator-runtime/runtime')
require('@babel/register')({ require('@babel/register')({
presets: [ presets: [
[ '@babel/env', { targets: { node: 'current' } } ] [ '@babel/env', { targets: { node: 'current' } } ]
], ],
plugins: [
'@babel/plugin-syntax-dynamic-import'
],
ignore: [ ignore: [
(path) => { (path) => {
// Transpile known packages // Transpile known packages
if (/(@nuxt|@nuxtjs)[\\/]/.test(path)) { if (/(@nuxt|@nuxtjs)[\\/]|proper-lockfile|webpack|vue-app/.test(path)) {
return false return false
} }
// Ignore everything else inside node_modules // Ignore everything else inside node_modules

View File

@ -60,7 +60,7 @@
"@nuxt/loading-screen": "^0.1.2", "@nuxt/loading-screen": "^0.1.2",
"@nuxt/opencollective": "^0.2.1", "@nuxt/opencollective": "^0.2.1",
"@nuxt/webpack": "2.5.0", "@nuxt/webpack": "2.5.0",
"core-js": "^3.0.0", "core-js": "^2.6.5",
"regenerator-runtime": "^0.13.2" "regenerator-runtime": "^0.13.2"
}, },
"engines": { "engines": {

View File

@ -37,7 +37,7 @@ Below is a list of all available parameters:
* **loose**, default `false` - '[@babel/preset-env](https://babeljs.io/docs/en/babel-preset-env#loose)' parameter and also sets `loose=true` for `@babel/plugin-proposal-class-properties` * **loose**, default `false` - '[@babel/preset-env](https://babeljs.io/docs/en/babel-preset-env#loose)' parameter and also sets `loose=true` for `@babel/plugin-proposal-class-properties`
* **modern** passed by builder, either `true` or `false` * **modern** passed by builder, either `true` or `false`
* **modules**, default `false` - '[@babel/preset-env](https://babeljs.io/docs/en/babel-preset-env#modules)' parameter * **modules**, default `false` - '[@babel/preset-env](https://babeljs.io/docs/en/babel-preset-env#modules)' parameter
* **polyfills**, default `['es.array.iterator','es.promise','es.object.assign','es.promise.finally']`, more [in the corresponding repository](https://github.com/zloirock/core-js) * **polyfills**, default `['es6.array.iterator','es6.promise','es6.object.assign','es7.promise.finally']`, more [in the corresponding repository](https://github.com/zloirock/core-js)
* **shippedProposals** - '[@babel/preset-env](https://babeljs.io/docs/en/babel-preset-env#shippedproposals)' parameter * **shippedProposals** - '[@babel/preset-env](https://babeljs.io/docs/en/babel-preset-env#shippedproposals)' parameter
* **spec** - '[@babel/preset-env](https://babeljs.io/docs/en/babel-preset-env#spec)' parameter * **spec** - '[@babel/preset-env](https://babeljs.io/docs/en/babel-preset-env#spec)' parameter
* **targets** - '[@babel/preset-env](https://babeljs.io/docs/en/babel-preset-env#targets)' parameter * **targets** - '[@babel/preset-env](https://babeljs.io/docs/en/babel-preset-env#targets)' parameter

View File

@ -17,10 +17,8 @@
"@babel/plugin-transform-runtime": "^7.4.0", "@babel/plugin-transform-runtime": "^7.4.0",
"@babel/preset-env": "^7.4.2", "@babel/preset-env": "^7.4.2",
"@babel/runtime": "^7.4.2", "@babel/runtime": "^7.4.2",
"@babel/runtime-corejs3": "^7.4.2",
"@vue/babel-preset-jsx": "^1.0.0-beta.2", "@vue/babel-preset-jsx": "^1.0.0-beta.2",
"core-js": "^3.0.0", "core-js": "^2.6.5"
"core-js-compat": "^3.0.0"
}, },
"publishConfig": { "publishConfig": {
"access": "public" "access": "public"

View File

@ -1,19 +1,19 @@
const defaultPolyfills = [ const defaultPolyfills = [
// Promise polyfill alone doesn't work in IE, // Promise polyfill alone doesn't work in IE,
// Needs this as well. see: #1642 // Needs this as well. see: #1642
'es.array.iterator', 'es6.array.iterator',
// This is required for webpack code splitting, vuex etc. // This is required for webpack code splitting, vuex etc.
'es.promise', 'es6.promise',
// this is needed for object rest spread support in templates // this is needed for object rest spread support in templates
// as vue-template-es2015-compiler 1.8+ compiles it to Object.assign() calls. // as vue-template-es2015-compiler 1.8+ compiles it to Object.assign() calls.
'es.object.assign', 'es6.object.assign',
// #2012 es.promise replaces native Promise in FF and causes missing finally // #2012 es7.promise replaces native Promise in FF and causes missing finally
'es.promise.finally' 'es7.promise.finally'
] ]
function getPolyfills(targets, includes, { ignoreBrowserslistConfig, configPath }) { function getPolyfills(targets, includes, { ignoreBrowserslistConfig, configPath }) {
const { isPluginRequired } = require('@babel/preset-env') const { isPluginRequired } = require('@babel/preset-env')
const builtInsList = require('core-js-compat/data') const builtInsList = require('@babel/preset-env/data/built-ins.json.js')
const getTargets = require('@babel/preset-env/lib/targets-parser').default const getTargets = require('@babel/preset-env/lib/targets-parser').default
const builtInTargets = getTargets(targets, { const builtInTargets = getTargets(targets, {
ignoreBrowserslistConfig, ignoreBrowserslistConfig,
@ -66,7 +66,7 @@ module.exports = (context, options = {}) => {
polyfills = [] polyfills = []
} }
const corejs = { version: 3 } const corejs = { version: 2 }
// Pass options along to babel-preset-env // Pass options along to babel-preset-env
presets.push([ presets.push([

View File

@ -17,7 +17,6 @@
"caniuse-lite": "^1.0.30000951", "caniuse-lite": "^1.0.30000951",
"chalk": "^2.4.2", "chalk": "^2.4.2",
"consola": "^2.5.7", "consola": "^2.5.7",
"core-js": "^3.0.0",
"css-loader": "^2.1.1", "css-loader": "^2.1.1",
"cssnano": "^4.1.10", "cssnano": "^4.1.10",
"eventsource-polyfill": "^0.9.6", "eventsource-polyfill": "^0.9.6",

View File

@ -188,8 +188,7 @@ export default class WebpackBaseConfig {
'@': path.join(srcDir), '@': path.join(srcDir),
'@@': path.join(rootDir), '@@': path.join(rootDir),
[assetsDir]: path.join(srcDir, assetsDir), [assetsDir]: path.join(srcDir, assetsDir),
[staticDir]: path.join(srcDir, staticDir), [staticDir]: path.join(srcDir, staticDir)
'core-js': path.dirname(require.resolve('core-js/package.json'))
} }
} }

View File

@ -633,14 +633,6 @@
pirates "^4.0.0" pirates "^4.0.0"
source-map-support "^0.5.9" source-map-support "^0.5.9"
"@babel/runtime-corejs3@^7.4.2":
version "7.4.2"
resolved "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.4.2.tgz#d951565aa21cc698abbd9866d54d536814e1c4d9"
integrity sha512-KhRhNFTBO4bxwH/X21qder3+IhvIp4Bz2qMV9exQUG60q1maoEq2ucKzRqsmMfZ0LnAOoYLE4NhLztKIiYUiJg==
dependencies:
core-js-pure "^3.0.0"
regenerator-runtime "^0.13.2"
"@babel/runtime@^7.4.2": "@babel/runtime@^7.4.2":
version "7.4.2" version "7.4.2"
resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.4.2.tgz#f5ab6897320f16decd855eed70b705908a313fe8" resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.4.2.tgz#f5ab6897320f16decd855eed70b705908a313fe8"
@ -3514,7 +3506,7 @@ core-js-compat@^3.0.0:
core-js-pure "3.0.0" core-js-pure "3.0.0"
semver "^5.6.0" semver "^5.6.0"
core-js-pure@3.0.0, core-js-pure@^3.0.0: core-js-pure@3.0.0:
version "3.0.0" version "3.0.0"
resolved "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.0.0.tgz#a5679adb4875427c8c0488afc93e6f5b7125859b" resolved "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.0.0.tgz#a5679adb4875427c8c0488afc93e6f5b7125859b"
integrity sha512-yPiS3fQd842RZDgo/TAKGgS0f3p2nxssF1H65DIZvZv0Od5CygP8puHXn3IQiM/39VAvgCbdaMQpresrbGgt9g== integrity sha512-yPiS3fQd842RZDgo/TAKGgS0f3p2nxssF1H65DIZvZv0Od5CygP8puHXn3IQiM/39VAvgCbdaMQpresrbGgt9g==
@ -3524,7 +3516,7 @@ core-js@3.0.0, core-js@^3.0.0:
resolved "https://registry.npmjs.org/core-js/-/core-js-3.0.0.tgz#a8dbfa978d29bfc263bfb66c556d0ca924c28957" resolved "https://registry.npmjs.org/core-js/-/core-js-3.0.0.tgz#a8dbfa978d29bfc263bfb66c556d0ca924c28957"
integrity sha512-WBmxlgH2122EzEJ6GH8o9L/FeoUKxxxZ6q6VUxoTlsE4EvbTWKJb447eyVxTEuq0LpXjlq/kCB2qgBvsYRkLvQ== integrity sha512-WBmxlgH2122EzEJ6GH8o9L/FeoUKxxxZ6q6VUxoTlsE4EvbTWKJb447eyVxTEuq0LpXjlq/kCB2qgBvsYRkLvQ==
core-js@^2.4.0: core-js@^2.4.0, core-js@^2.6.5:
version "2.6.5" version "2.6.5"
resolved "https://registry.npmjs.org/core-js/-/core-js-2.6.5.tgz#44bc8d249e7fb2ff5d00e0341a7ffb94fbf67895" resolved "https://registry.npmjs.org/core-js/-/core-js-2.6.5.tgz#44bc8d249e7fb2ff5d00e0341a7ffb94fbf67895"
integrity sha512-klh/kDpwX8hryYL14M9w/xei6vrv6sE8gTHDG7/T/+SEovB/G4ejwcfE/CBzO6Edsu+OETZMZ3wcX/EjUkrl5A== integrity sha512-klh/kDpwX8hryYL14M9w/xei6vrv6sE8gTHDG7/T/+SEovB/G4ejwcfE/CBzO6Edsu+OETZMZ3wcX/EjUkrl5A==