From 73bd8dc9bd4a904f5b507ae53bbaccb7faf6cae2 Mon Sep 17 00:00:00 2001 From: 07akioni <07akioni2@gmail.com> Date: Fri, 4 Dec 2020 19:40:17 +0800 Subject: [PATCH] built: add bable plugin --- babel.config.js | 2 +- package.json | 11 ++++++----- rollup.config.js | 1 + vite.config.js | 6 +++--- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/babel.config.js b/babel.config.js index 0a90a8a18..774b510e9 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,4 +1,4 @@ -// the file is used by jest, shouldn't be removed +// the file is used for jest testing & site building module.exports = { presets: ['@babel/preset-env'] } diff --git a/package.json b/package.json index 4fd186c27..be21e0581 100644 --- a/package.json +++ b/package.json @@ -42,8 +42,9 @@ "README.md" ], "devDependencies": { - "@babel/preset-env": "^7.12.1", + "@babel/preset-env": "^7.12.7", "@rollup/plugin-alias": "^3.1.1", + "@rollup/plugin-babel": "^5.2.2", "@rollup/plugin-node-resolve": "^10.0.0", "@rollup/plugin-replace": "^2.3.4", "@types/jest": "^26.0.15", @@ -80,14 +81,14 @@ }, "dependencies": { "@css-render/plugin-bem": "^0.11.1", - "@vicons/fluent": "^0.0.1", - "@vicons/ionicons-v4": "^0.0.1", - "@vicons/ionicons-v5": "^0.0.1", + "@vicons/fluent": "~0.0.3", + "@vicons/ionicons-v4": "~0.0.3", + "@vicons/ionicons-v5": "~0.0.3", "async-validator": "^3.4.0", "css-render": "^0.11.1", "date-fns": "^2.9.0", "evtd": "^0.1.0", - "highlight.js": "^9.18.1", + "highlight.js": "^10.4.1", "lodash-es": "^4.17.15", "seemly": "^0.0.1-alpha.2", "treemate": "^0.1.11", diff --git a/rollup.config.js b/rollup.config.js index a718b34d8..dfb81fde4 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -8,6 +8,7 @@ function externalValidator (patterns) { return id => patterns.some(pattern => id.startsWith(pattern)) } +// do not use babel when build library, use it when only build the site module.exports = { input: 'src/index.js', output: [ diff --git a/vite.config.js b/vite.config.js index eab433fd9..edccce2af 100644 --- a/vite.config.js +++ b/vite.config.js @@ -18,8 +18,7 @@ module.exports = { 'highlight.js/lib/core', 'highlight.js/lib/languages/cpp', 'highlight.js/lib/languages/javascript', - 'highlight.js/lib/languages/python', - 'vooks' + 'highlight.js/lib/languages/python' ] }, alias: { @@ -46,7 +45,8 @@ module.exports = { rollupDemoPlugin(), rollupCssRenderPlugin(), babel({ - babelHelpers: 'bundled' + babelHelpers: 'bundled', + exclude: 'node_modules/**' }) ] },