how to access htmlWebpackPlugin.options in index.js when HtmlWebpackPlugin use index.js as template ?
code example:
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