¿Cómo acceder a htmlWebpackPlugin.options en index.js cuando HtmlWebpackPlugin usa index.js como plantilla?
ejemplo de código:
webpack.config.js:
plugins: [ new HtmlWebpackPlugin({ title: "title", inject: true, template:path.resolve(appDirectory, "src/index.js") }), ],src/index.js:
let html='\ <!DOCTYPE html>\ <html>\ <head>\ <title>how to access htmlWebpackPlugin.options.title?</title>\ </head>\ <body>\ how to access htmlWebpackPlugin.options here?\ </body>\ </html>' module.exports = html