0

I'm using html-webpack-plugin to produce a html version of a ejs template. I'm using the ejs on staging and for Dev, but on production there needs to be a html file. In the EJS I have conditions to hide things on staging, but when I run webpack I get the following error:

   Module build failed: SyntaxError: Unexpected token if
- Function
- lodash.js:14843

ive tried to include ejs-loaders and such but still not working. Any suggestions? This is how my webpack script looks like:

    new HtmlWebpackPlugin({
      filename: 'app.html',
      template: 'views/app.ejs',
      inject: false,
      removeComments: true,
      collapseWhitespace: true
    })
4

1 回答 1

0

我解决了这个问题,我在使用 ejs-loader 时路径不正确

模板:'ejs-render-loader!./views/app.ejs',

于 2017-05-05T17:16:31.137 回答