vite-plugin-html
vite-plugin-html copied to clipboard
打包的时候会把html模板文件的注释给去除了,怎么保留注释呢?
createHtmlPlugin({
minify:{
collapseWhitespace: false,
keepClosingSlash: false,
removeComments: false,
removeRedundantAttributes: false,
removeScriptTypeAttributes: false,
removeStyleLinkTypeAttributes: false,
useShortDoctype: false,
minifyCSS: false,
},
entry:'/src/main.ts',
template:'index.html',
inject:{
data:{
buildTime:new Date()
}
}
})
似乎是加了entry 后注释被移除了
遇到同样的问题
createHtmlPlugin返回了两个插件 使用第二个(createMinifyHtmlPlugin),然后 在createHtmlPlugin optios 里面 minify配置里面加上removeComments:false
createHtmlPlugin返回了两个插件 使用第二个(createMinifyHtmlPlugin),然后 在createHtmlPlugin optios 里面 minify配置里面加上removeComments:false
遇到同样的问题使用 ssi 需要保留html的注释。 使用第二个插件可以具体说下吗?
似乎是这里默认丢弃了comments?