Webpack:html文件名中的正则表达式?

Webpack: Regex in html filename?

提问人:aryan 提问时间:10/30/2023 更新时间:10/30/2023 访问量:25

问:

我在 url 中的文件名是这样的:

index.qwe123.html

其中 qwe123 是随机字符串。我想显示索引.html文件,而不考虑这个字符串。如何在 Webpack 配置中自定义:

new HtmlWebpackPlugin({
            filename: 'index.html',
            template: path.resolve(__dirname, SOURCE_ROOT + '/static/index.html')
        })

因此,无论动态部分如何,都会提供此索引.html。

javascript node.js webpack html-webpack-plugin webpack-html-loader

评论

0赞 aryan 10/31/2023
“path.resolve(__dirname, SOURCE_ROOT + '/static/index.html')” 可以接受正则表达式吗?
1赞 Wyck 10/31/2023
我想知道如何使用通配符将 HtmlWebpackPlugin 用于多个文件? 对您有帮助吗?
0赞 aryan 10/31/2023
@Wyck有一些想法。谢谢!

答: 暂无答案