【webpack】webpack的html-webpack-plugin中的title不起作用?(已解决)

只是在webpack中的html-webpack-plugin中配置title是不起作用的

new HtmlWebpackPlugin({
    title: 'React Common Backstage',
    template: path.resolve(__dirname, 'public/index.html')
})

还需要在index.html文件中引入变量

<title><%= htmlWebpackPlugin.options.title %>title>

现在就可以咯。
【webpack】webpack的html-webpack-plugin中的title不起作用?(已解决)_第1张图片

你可能感兴趣的:(webpack,webpack,html,前端)