element和vant的按需引入
.babelrc文件
{ "presets": [ [ "env", { "modules": false, "targets": { "browsers": [ "> 1%", "last 2 versions", "not ie <= 8" ] } } ], "stage-2" ], "plugins": [ "transform-vue-jsx", "transform-runtime", [ // vant 按需引入 "import", { "libraryName": "vant", "libraryDirectory": "es", "style": true } ], [ // element-ui 按需引入 "component", { "libraryName": "element-ui", "styleLibraryName": "theme-chalk" } ] ] }