webpack打包配置禁止html标签所有转为小写

用webpack打包页面,发现html中特别写的用来给后端识别的大写标签所有被转为了小写标签,这时候须要将加一个配置 ,caseSensitive:true ,禁止大小写转换。html

webpack配置:webpack

 {
                test: /\.html$/,
                use: [
                    {
                        loader: "html-loader",
                        options: {
                            minimize: true,// 加载器切换到优化模式,启用压缩。
                            caseSensitive:true // 以区分大小写的方式处理属性(对于自定义HTML标记颇有用),即禁止html标签所有转为小写

                        }
                    }
                ]
            }

参考文档连接:git

https://github.com/kangax/html-minifier#options-quick-referencegithub

https://github.com/jantimon/html-webpack-plugin#optionsweb

相关文章
相关标签/搜索