1.引入vue-cli-plugin-dll插件
npm install vue-cli-[lugin-dll
2.vue.config.js中加入需要排除的插件
pluginOptions: {
dll: {
//这里放的是你的依赖插件,就是你项目安装的其他的插件,将这些插件的名字依次加在后面,我建议将所有项目依赖插件全部放在后面
//注意这里不能放webpack,gulp等需要node环境的插件,我尝试将babel等放到这里报错提示没有V8环境
entry: [ "@fullcalendar/core",
"@fullcalendar/daygrid",
"@fullcalendar/interaction",
"@fullcalendar/resource-timeline",
"@fullcalendar/timeline",
"@fullcalendar/vue",
"@riophae/vue-treeselect",
"@tinymce/tinymce-vue",
"async-validator",
"axios",
"bpmn-js-token-simulation",
"core-js",
"echarts",
"echarts-gl",
"el-tree-transfer",
"element-ui",
"file-saver",
"highlight.js",
"iframe-resizer",
"js-cookie",
"jsbarcode",
"jwt-decode",
"min-dash",
"normalize.css",
"nprogress",
"ol",
"qrcodejs2",
"script-loader",
"sockjs-client",
"stompjs",
"tinymce",
"uuid",
"v-viewer",
"vue",
"vue-cli-plugin-dll",
"vue-count-to",
"vue-grid-layout",
"vue-router",
"vue-seamless-scroll",
"vuedraggable",
"vuex",
"xlsx",
"xml-js"],
//dll 编译后的链接库的地址
cacheFilePath: path.resolve(__dirname, './public'),
// 是否开启 DllReferencePlugin,
open: true,
// 在执行 `dev` , `build` 等其他指令时,程序会自动将 `dll` 指令生成的 `*.dll.js` 等文件自动注入到 index.html 中。
inject: true,
}
3.package.json中加入运行脚本
"dll": "vue-cli-service dll"