From c436839a17f73011b986e42b83318e15755b9546 Mon Sep 17 00:00:00 2001 From: "Xin Du (Clark)" Date: Thu, 8 Aug 2019 10:09:17 +0100 Subject: [PATCH] refactor(babel-preset-app): remove `babel-plugin-dynamic-import-node` (#6197) --- babel.config.js | 3 +-- package.json | 1 - packages/babel-preset-app/README.md | 2 +- packages/babel-preset-app/package.json | 1 - packages/babel-preset-app/src/index.js | 1 - 5 files changed, 2 insertions(+), 6 deletions(-) diff --git a/babel.config.js b/babel.config.js index a3f41eae70..d5c9eacc1d 100644 --- a/babel.config.js +++ b/babel.config.js @@ -11,8 +11,7 @@ module.exports = function (api) { node: 'current' } }] - ], - plugins: ['dynamic-import-node'] + ] } } return {} diff --git a/package.json b/package.json index dfa39b5a4b..e9345260f1 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,6 @@ "@vue/test-utils": "^1.0.0-beta.29", "babel-eslint": "^10.0.2", "babel-jest": "^24.8.0", - "babel-plugin-dynamic-import-node": "^2.3.0", "cheerio": "^1.0.0-rc.3", "codecov": "^3.5.0", "consola": "^2.10.0", diff --git a/packages/babel-preset-app/README.md b/packages/babel-preset-app/README.md index d79230515c..f1d2408e5f 100644 --- a/packages/babel-preset-app/README.md +++ b/packages/babel-preset-app/README.md @@ -4,7 +4,7 @@ ## Usage -This is the default preset used by Nuxt, which is mainly a wrapper around the `@babel/preset-env` preset. It also optionally uses the `@vue/babel-preset-jsx` preset as well as `@babel/plugin-syntax-dynamic-import`, `@babel/plugin-proposal-decorators`, `@babel/plugin-proposal-class-properties`, `@babel/plugin-transform-runtime`. Furthermore the preset is adding polyfills. +This is the default preset used by Nuxt, which is mainly a wrapper around the `@babel/preset-env` preset. It also optionally uses the `@vue/babel-preset-jsx` preset as well as `@babel/plugin-proposal-decorators`, `@babel/plugin-proposal-class-properties`, `@babel/plugin-transform-runtime`. Furthermore the preset is adding polyfills. **Note**: Since `core-js@2` and `core-js@3` are both supported from Babel 7.4.0, we recommend directly adding `core-js` and setting the version via the [`corejs`](#corejs) option. diff --git a/packages/babel-preset-app/package.json b/packages/babel-preset-app/package.json index af12d2e127..b58928f1c6 100644 --- a/packages/babel-preset-app/package.json +++ b/packages/babel-preset-app/package.json @@ -13,7 +13,6 @@ "@babel/core": "^7.5.5", "@babel/plugin-proposal-class-properties": "^7.5.5", "@babel/plugin-proposal-decorators": "^7.4.4", - "@babel/plugin-syntax-dynamic-import": "^7.2.0", "@babel/plugin-transform-runtime": "^7.5.5", "@babel/preset-env": "^7.5.5", "@babel/runtime": "^7.5.5", diff --git a/packages/babel-preset-app/src/index.js b/packages/babel-preset-app/src/index.js index 3e4b0e8a44..9c28fe195b 100644 --- a/packages/babel-preset-app/src/index.js +++ b/packages/babel-preset-app/src/index.js @@ -120,7 +120,6 @@ module.exports = (context, options = {}) => { } plugins.push( - require('@babel/plugin-syntax-dynamic-import'), [require('@babel/plugin-proposal-decorators'), { decoratorsBeforeExport, legacy: decoratorsLegacy !== false