Skip to content

Commit c338ea7

Browse files
committed
Set output.globalObject option in Webpack config
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.
1 parent 1456df0 commit c338ea7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

webpack.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ module.exports = {
2222
// global export name if needed
2323
library: 'RemoteStorage',
2424
libraryTarget: 'umd',
25-
umdNamedDefine: true
25+
umdNamedDefine: true,
26+
globalObject: 'this'
2627
},
2728
// the only external dependecy is xmlhttprequest because it is
2829
// different in browser and in node env so user has to manage with that

0 commit comments

Comments
 (0)