html-webpack-plugin将类型属性添加到脚本标记

时间:2018-01-14 19:03:42

标签: html-webpack-plugin

版本2.30.1

new HtmlWebpackPlugin({
      title: 'Project',
      minify: {
        collapseWhitespace: true,
        preserveLineBreaks: false
      },
      hash: true,
      template: './src/index.html'
    })

结果:

<script type="text/javascript" src="bundle.js?d944356bf9245ce4bab5">

但应该是:

<script src="bundle.js?d944356bf9245ce4bab5">

配置错误或缺少某些内容或这是一个错误?

1 个答案:

答案 0 :(得分:0)

minify:{/ *你的道具* /,removeScriptTypeAttributes:true}

html-webpack-plugin 3.1.0

html-minifier 3.2.3