built: add bable plugin

This commit is contained in:
07akioni 2020-12-04 19:40:17 +08:00
parent 99f9f15aff
commit 73bd8dc9bd
4 changed files with 11 additions and 9 deletions

View File

@ -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']
}

View File

@ -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",

View File

@ -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: [

View File

@ -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/**'
})
]
},