html-webpack-plugin不输出script标签的方法

那就是修改源码

约550行:

    if (!this.options.disableScript) {
      if (this.options.inject === 'head') {
        head = head.concat(scripts);
      } else {
        body = body.concat(scripts);
      }
    }

然后这样使用:

    new HtmlWebpackPlugin({
      disableScript: true,
      //...
    })
原文地址:https://www.cnblogs.com/xiangnan/p/9566952.html