Closed jamesehly closed 6 years ago
I read some more on migrating webpack to 2.0 and it seems that they worked in a workaround for this issue (https://webpack.js.org/guides/migrating/#loaderoptionsplugin-context). You can use the LoaderOptionsPlugin to replicate how the config used to work. Adding this fixed my issue:
plugins: [
...
new webpack.LoaderOptionsPlugin({
options: {
macros: {
header: function() { return "'...'"},
footer: function() { return "'...'"}
}
}
})
...
],
Webpack 2 complains about the macros option being in the configuration where the documentation says it should be
If I place it in the loader options, then the macros don't seem to get loaded:
So can someone show me an example that works with webpack 2?