How can i pass webpack environment variables in html?

You can use html-webpack-plugin. You will have to use .ejs or some other template language and then use like that

new HtmlWebpackPlugin({
        template: './src/public/index.ejs',
        inject: 'body',
        environment: process.env.NODE_ENV
    }),

in index.ejs

<body class="<%= htmlWebpackPlugin.options.environment %>">

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)