Html index file not created using HtmlWebpackPlugin on Linux

I have a reaction project, and when creating a project, this command starts:

new HtmlWebpackPlugin({
  inject: true,
  template: 'public/index.html',
  minify: {
    removeComments: true,
    collapseWhitespace: true,
    removeRedundantAttributes: true,
    useShortDoctype: true,
    removeEmptyAttributes: true,
    removeStyleLinkTypeAttributes: true,
    keepClosingSlash: true,
    minifyJS: true,
    minifyCSS: true,
    minifyURLs: true
  },
  filename: '/index.' + Date.now() + '.html'
}),

When I create a project on Windows, it generates an index file with fingerprints, similar index.1514560078687.htmlinside a folder build, along with other assets and files. But when I run it in Ubuntu, it generates all the files except the index file. Even if I installed filename: '/index.html', it will not be generated.

Any idea?

+4
source share
1 answer

It seems to be HtmlWebpackPluginstoring the index.htmlfile in the root directory. Have you checked it?

Try adding .up /index.html, this might work for you.

+1
source

Source: https://habr.com/ru/post/1691513/


All Articles