0
点赞
收藏
分享

微信扫一扫

parcel 按需引入element

五殳师兄 2022-10-10 阅读 156


​.babelrc​

{
"presets": [["@babel/preset-env", { "modules": false }]],
"plugins": [
[
"component",
{
"libraryName": "element-ui",
"styleLibraryName": "theme-chalk"
}
]
]
}

​package.json​​构建后打的包就是几十k

"scripts": {
"dev": "parcel public/index.html --out-dir dist",
"serve": "npm run dev",
"build": "rm -rf build && parcel build public/index.html --no-cache --out-dir build --public-url ."
},


举报

相关推荐

0 条评论