próbuję zastąpić zmienną w index.html, który wygląda tak:używać HTML-WebPack-plugin sznurkiem-replace-ładowarki w WebPacka
<meta name='author' content=$variable>
w pliku konfiguracyjnym używać:
{
test: /index\.html$/,
loader: 'string-replace',
query: {
search: '$variable',
replace: 'stuff to inject',
},
}
loaders
w tablicy, a następnie w plugins
:
new HtmlWebpackPlugin({
template: conf.path.src('src/index.html'),
inject: true,
})
Wyniki
Ale to ustawienie w:
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.
Czy macie jakieś pomysły co to może być spowodowane i jak można debugować to?
Do debugowania używam [węzła żelaznego] (https://github.com/sa/iron-node), który pozwala dodawać instrukcje debuggera do modułów węzłów – jantimon