我需要将index.html公开复制到公共路径中定义的特定文件夹中,但这并不像我预期的那样工作。
我也不希望 cli 在 html 文件中包含标头和脚本引用。
我的 index html 输出应该只包含:<div id='app'></div>
加上我们的 CMS 系统所需的一些特定 html 标签。
为此,我使用:
chainWebpack: config => {
// disable splitting of JS files for dist folder
config.optimization.delete('splitChunks')
config.plugins
.delete('html')
.delete('prefetch')
.delete('preload')
}
但是我的index.html没有被复制到我的输出路径中。
如果我删除.delete('html')
,index.html将正常复制,但带有标题和脚本引用。
我对 Vue Cli 3 也有同样的想法,这曾经可以工作。我错过了什么?