猿问

webpack html-webpack-plugin minify:true

自动生成html插件

html-webpack-plugin

new HtmlWebpackPlugin({      title: 'React Title !',
      template: './template.html',
      minify:true,
      inject: 'body'
    }),

添加了 minify:true 参数后就会报错

ERROR in TypeError: Cannot use 'in' operator to search for 'html5' in true


慕莱坞森
浏览 1505回答 1
1回答

翻阅古今

据说是现在htmlminify没有默认值了,需要你自己指定:new HtmlWebpackPlugin({      title: 'React Title !',      template: './template.html',      minify: { removeAttributeQuotes: true },      inject: 'body'     }),这么来试试
随时随地看视频慕课网APP

相关分类

JavaScript
我要回答