繁体   English   中英

在Linux中未使用HtmlWebpackPlugin生成索引html文件

[英]The index html file is not being generated with HtmlWebpackPlugin in Linux

我有一个React项目,在构建项目时,此命令运行:

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'
}),

当我生成项目在Windows中,它会产生像指纹索引文件index.1514560078687.html文件夹内build与其他资产和文件一起。 但是,当我在Ubuntu中运行它时,它将生成除索引文件以外的所有文件。 即使我设置filename: '/index.html' ,也不会生成。

任何的想法?

看起来像HtmlWebpackPlugin在您的目录中存储index.html文件。 你检查了吗?

尝试添加. /index.html之前,它可能对您/index.html

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM