From 65c1f86ea33bd019d9a5d5d5a742cce17b537fb7 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Thu, 21 Mar 2019 15:18:37 +0330 Subject: [PATCH] fix(webpack): always resolve core-js to v3 (#5307) --- distributions/nuxt-legacy/package.json | 2 +- packages/babel-preset-app/package.json | 3 ++- packages/webpack/package.json | 1 + packages/webpack/src/config/base.js | 3 ++- yarn.lock | 2 +- 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/distributions/nuxt-legacy/package.json b/distributions/nuxt-legacy/package.json index debb6fdc77..5f58fb056b 100644 --- a/distributions/nuxt-legacy/package.json +++ b/distributions/nuxt-legacy/package.json @@ -60,7 +60,7 @@ "@nuxt/loading-screen": "^0.1.2", "@nuxt/opencollective": "^0.2.1", "@nuxt/webpack": "2.4.5", - "core-js": "3", + "core-js": "^3.0.0", "regenerator-runtime": "^0.13.2" }, "engines": { diff --git a/packages/babel-preset-app/package.json b/packages/babel-preset-app/package.json index 5b475f4433..2ff97acc28 100644 --- a/packages/babel-preset-app/package.json +++ b/packages/babel-preset-app/package.json @@ -19,7 +19,8 @@ "@babel/runtime": "^7.4.2", "@babel/runtime-corejs3": "^7.4.2", "@vue/babel-preset-jsx": "^1.0.0-beta.2", - "core-js": "3" + "core-js": "^3.0.0", + "core-js-compat": "^3.0.0" }, "publishConfig": { "access": "public" diff --git a/packages/webpack/package.json b/packages/webpack/package.json index a9ac3b8b77..0be32b26b1 100644 --- a/packages/webpack/package.json +++ b/packages/webpack/package.json @@ -17,6 +17,7 @@ "caniuse-lite": "^1.0.30000951", "chalk": "^2.4.2", "consola": "^2.5.7", + "core-js": "^3.0.0", "css-loader": "^2.1.1", "cssnano": "^4.1.10", "eventsource-polyfill": "^0.9.6", diff --git a/packages/webpack/src/config/base.js b/packages/webpack/src/config/base.js index ad4f8c946e..45b41639cf 100644 --- a/packages/webpack/src/config/base.js +++ b/packages/webpack/src/config/base.js @@ -188,7 +188,8 @@ export default class WebpackBaseConfig { '@': path.join(srcDir), '@@': path.join(rootDir), [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')) } } diff --git a/yarn.lock b/yarn.lock index 7ff034894e..dc68ffdd42 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3519,7 +3519,7 @@ core-js-pure@3.0.0, core-js-pure@^3.0.0: resolved "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.0.0.tgz#a5679adb4875427c8c0488afc93e6f5b7125859b" integrity sha512-yPiS3fQd842RZDgo/TAKGgS0f3p2nxssF1H65DIZvZv0Od5CygP8puHXn3IQiM/39VAvgCbdaMQpresrbGgt9g== -core-js@3, core-js@3.0.0, core-js@^3.0.0: +core-js@3.0.0, core-js@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/core-js/-/core-js-3.0.0.tgz#a8dbfa978d29bfc263bfb66c556d0ca924c28957" integrity sha512-WBmxlgH2122EzEJ6GH8o9L/FeoUKxxxZ6q6VUxoTlsE4EvbTWKJb447eyVxTEuq0LpXjlq/kCB2qgBvsYRkLvQ==