zoukankan      html  css  js  c++  java
  • React index.html引入script时 src中的斜杠都变成了空格,并且还多出了script标签 导致无法加载

    在使用react开发项目的时候 遇到了一个奇怪的问题,在index.html中引入script标签 script标签的src属性会把 / 斜杠变成空格,并且在body标签结尾追加script标签。

    就像这样

    我发现 HtmlWebpackPlugin 还内置了html-minifier插件 

    解决方法

    在webpack.config.dev.js中 找到

    plugins: [

    new HtmlWebpackPlugin({
          inject: true,
          template: paths.appHtml,
      // 在这里 追加一行代码
          minify: {},
        }),

    ]

  • 相关阅读:
    apio2018题解
    ynoi2018
    hdu2036
    Morley's Theorem
    计算几何
    luogu1355 神秘大三角
    poj2398
    洛谷---小L和小K的NOIP考后放松赛
    LibreOJ β Round #7
    python3
  • 原文地址:https://www.cnblogs.com/MainActivity/p/14754919.html
Copyright © 2011-2022 走看看