I'm posting this issue for reference more than anything else, in case others are searching for a fix. The temporary fix is at the end, perhaps it's worth adding that to the README?
When using this plugin with a fresh install of Webpack 4 (4.6.0 in my test) I get the following error:
ERROR in ReferenceError: window is not defined
Having dug into it further, it appears it is a side effect of this issue where the umd target generates invalid code for running inside a Node.js context.
The temporary fix is detailed here, where you can add the following to your Webpack config to change the global keyword from window to this:
output: {
// ...
globalObject: "this"
}
I'm posting this issue for reference more than anything else, in case others are searching for a fix. The temporary fix is at the end, perhaps it's worth adding that to the
README?When using this plugin with a fresh install of Webpack 4 (
4.6.0in my test) I get the following error:Having dug into it further, it appears it is a side effect of this issue where the
umdtarget generates invalid code for running inside a Node.js context.The temporary fix is detailed here, where you can add the following to your Webpack config to change the global keyword from
windowtothis: