How to inject custom meta tags in html-webpack-plugin?

前端 未结 3 1135
故里飘歌
故里飘歌 2021-01-01 00:09

I use Webpack along with the plugin html-webpack-plugin. Based on an environment variable, I want to inject a tag into th

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-01 00:26

       new HtmlWebpackPlugin({
         template: 'index.html',
         meta: {
           author: process.env.AUTHOR
         }
       });
    

    resulting in the inclusion of the following within your head tag.

提交回复
热议问题