-
module.exports
常見是對象類型,其實也可用數(shù)組類型; - 注意編譯順序,從后往前 編:
- 也就是說先編
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 文件夾
}
}
];
文章來源地址http://www.zghlxwxcb.cn/news/detail-720810.html
文章來源:http://www.zghlxwxcb.cn/news/detail-720810.html
到了這里,關于《基于 Vue 組件庫 的 Webpack5 配置》9.module.exports 可為數(shù)組類型且注意編譯順序的文章就介紹完了。如果您還想了解更多內容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!