0

My template file is coming from some other projects and I don't know that. I have to add lang property to the template file using htmlwebpack plugin. How can I do the same.

const htmlPlugin = new HtmlWebpackPlugin({
            showErrors: true,
            minify: false,
            hash: true,
            path: Config.output,
            title: '',
            template: Config.htmlEntry,
            filename: 'index.html',
            
        });
3
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. Commented May 12, 2022 at 13:13
  • Currently html file generated in dist folder is like below <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width,initial-scale=1"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title></title> <script defer="defer" src="main.js"></script> </head> <body> <section id="index"></section> </body> </html> I want to lang attribute in it through htmlwebpack plugin so that the geneated file have lang attribute like <html lang="en"> </html> Commented May 13, 2022 at 13:49
  • Why not add the "lang" attribute to the HTML template directly? Commented Jul 6, 2023 at 6:00

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.