《基于 Vue 组件库 的 Webpack5 配置》9.module.exports 可为数组类型且注意编译顺序
《基于 Vue 组件库 的 Webpack5 配置》9.module.exports 可为数组类型且注意编译顺序
module.exports
常见是对象类型,其实也可用数组类型;- 注意编译顺序,从后往前 编:
- 也就是说先编
another.js
,再编index.js
; - 所以代码第 9 行不能设置为
true
,仅在第一次,也就是代码第19行设置一次即可清空整个output
文件夹; - 如果代码第 9 行设置为
true
,则在编index.js
时,会删除another.js
已编译好的文件;
- 也就是说先编
module.exports = [{mode: 'production',entry: {"indexs": './index.js' ,},output: {filename: '[name].js',// clean: true, }},{mode: 'production',entry: {"another": './another.js' ,},output: {filename: '[name].js',clean: true, // 在每次构建前清理 output 文件夹}}
];
最新文章
- Animate 2024 for mac动画制作软件
- Word2Vec浅谈
- 优思学院:SPC控制线为什么是±3西格玛?
- c++ jthread 使用详解
- 使用proxy把后端返回的图片域名替换成目标域名
- 只有开源才能拯救AI
- 需要买哪些网络设备才能过等保?求解!
- 【uniapp】确认弹出框,选择确定和取消
- 【Amazon】云上探索实验室—了解 AI 编程助手 Amazon Codewhisperer
- APM系列之三
- 免费群学习网络安全
- 【python自动化】Playwright基础教程(八)鼠标操作
- 一些可以参考的文档集合15
- 简单地聊一聊Spring Boot的构架
- 本地化工具:Soluling Localization Crack
- Ubuntu环境下为串口设置别名
- 互联网Java工程师面试题·微服务篇·第三弹
- 面试算法题之跳跃游戏,“You Jump, I Jump”
- 自然语言处理实战项目21
- 观察者模式