I'm trying to replace a variable in index.html that looks like this:
<meta name='author' content=$variable>
In the config file I use:
{
test: /index\.html$/,
loader: 'string-replace',
query: {
search: '$variable',
replace: 'stuff to inject',
},
}
In the loaders
array, and then in plugins
:
new HtmlWebpackPlugin({
template: conf.path.src('src/index.html'),
inject: true,
})
But this setting results in:
ERROR in ./~/html-webpack-plugin/lib/loader.js!./src/index.html
Module parse failed (...) Unexpected token (1:0)
You may need an appropriate loader to handle this file type.
Do you have any ideas what this can be caused by or how can I debug this?