Skip to content

Commit

Permalink
Set output.globalObject option in Webpack config
Browse files Browse the repository at this point in the history
Fixes #1126

This fixes a reference error when using the build in a WebWorker.

This is a workaround taken from webpack/webpack#6642 (comment)
and should be replaced by `target: "universal" when webpack/webpack#6525
has been implemented.
  • Loading branch information
galfert authored and raucao committed Oct 31, 2018
1 parent aec698e commit 23b8246
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ module.exports = {
// global export name if needed
library: 'RemoteStorage',
libraryTarget: 'umd',
umdNamedDefine: true
umdNamedDefine: true,
globalObject: 'this'
},
// the only external dependecy is xmlhttprequest because it is
// different in browser and in node env so user has to manage with that
Expand Down

0 comments on commit 23b8246

Please sign in to comment.