From 18cbe8187f15e1d828502e156c53991242817298 Mon Sep 17 00:00:00 2001 From: AYELance <2463168510@qq.com> Date: Mon, 10 May 2021 11:42:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=87=E7=BA=A7babel7&corejs3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .babelrc | 35 +++++++++++++++++++++++++++++++---- package.json | 29 ++++++++++++++++++----------- src/components/index.js | 2 +- 3 files changed, 50 insertions(+), 16 deletions(-) diff --git a/.babelrc b/.babelrc index aafe54c..537e9b5 100644 --- a/.babelrc +++ b/.babelrc @@ -1,13 +1,40 @@ { "presets": [ - ["es2015", { "modules": false }], - "stage-2" + [ + "@babel/preset-env", + { + "modules": false + } + ] + ], + "plugins": [ + [ + "@babel/plugin-transform-runtime", + { + "corejs": 3 + } + ], + "@babel/plugin-syntax-dynamic-import", + "@babel/plugin-syntax-import-meta", + "@babel/plugin-proposal-class-properties", + "@babel/plugin-proposal-json-strings", + [ + "@babel/plugin-proposal-decorators", + { + "legacy": true + } + ], + "@babel/plugin-proposal-function-sent", + "@babel/plugin-proposal-export-namespace-from", + "@babel/plugin-proposal-numeric-separator", + "@babel/plugin-proposal-throw-expressions" ], - "plugins": ["transform-runtime"], "comments": false, "env": { "test": { - "plugins": [ "istanbul" ] + "plugins": [ + "istanbul" + ] } } } diff --git a/package.json b/package.json index e4b9248..59ce9b6 100644 --- a/package.json +++ b/package.json @@ -30,21 +30,28 @@ "vue": "^2.6.10" }, "devDependencies": { + "@babel/cli": "^7.0.0", + "@babel/core": "^7.0.0", + "@babel/plugin-proposal-class-properties": "^7.0.0", + "@babel/plugin-proposal-decorators": "^7.0.0", + "@babel/plugin-proposal-export-namespace-from": "^7.0.0", + "@babel/plugin-proposal-function-sent": "^7.0.0", + "@babel/plugin-proposal-json-strings": "^7.0.0", + "@babel/plugin-proposal-numeric-separator": "^7.0.0", + "@babel/plugin-proposal-throw-expressions": "^7.0.0", + "@babel/plugin-syntax-dynamic-import": "^7.0.0", + "@babel/plugin-syntax-import-meta": "^7.0.0", + "@babel/plugin-transform-runtime": "^7.0.0", + "@babel/polyfill": "^7.0.0", + "@babel/preset-env": "^7.0.0", + "@babel/register": "^7.0.0", + "@babel/runtime-corejs3": "^7.0.0", "autoprefixer": "^6.7.2", "axios": "^0.19.0", - "babel-cli": "^6.26.0", - "babel-core": "^6.26.3", - "babel-eslint": "^7.1.1", - "babel-loader": "^7.1.5", + "babel-eslint": "^9.0.0", + "babel-loader": "^8.0.0", "babel-plugin-istanbul": "^3.1.2", - "babel-plugin-transform-runtime": "^6.22.0", - "babel-polyfill": "^6.22.0", - "babel-preset-es2015": "^6.24.1", "babel-preset-es2015-rollup": "^3.0.0", - "babel-preset-stage-2": "^6.22.0", - "babel-preset-stage-3": "^6.24.1", - "babel-register": "^6.22.0", - "babel-runtime": "^6.26.0", "bulma": "^0.7.5", "chai": "^4.2.0", "chalk": "^2.4.2", diff --git a/src/components/index.js b/src/components/index.js index 8fcde9b..b1e3f07 100644 --- a/src/components/index.js +++ b/src/components/index.js @@ -1,5 +1,5 @@ // es6 polyfill -import 'core-js/fn/array/find-index'; +import 'core-js-pure/features/array/virtual/find-index'; import oolongAutoComplete from './auto-complete'; import oolongSpin from './spin'; -- Gitee