搜尋

首頁  >  問答  >  主體

javascript - html-webpack-plugin与jinja2有冲突,如何能让html-webpack-plugin插件不去解析%

ringa_leeringa_lee2872 天前666

全部回覆(1)我來回復

  • 天蓬老师

    天蓬老师2017-04-17 16:37:38

    By default (if you don't specify any loader in any way) a fallback ejs loader kicks in.

    如果沒有置頂 loader,那麼預設使用 ejs 作為模板引擎。

    所以可以顯示指定 html-loader

    {
      module: {
        loaders: [
          {
            test: /\.html$/,
            loader: 'html-loader'
          },
      },
      plugins: [
        new HtmlWebpackPlugin({
          template: 'src/index.html'
        })
      ]
    }

    回覆
    0
  • 取消回覆