Skip to content

Commit 3240ee1

Browse files
committed
Add a message about output.globalObject=window. Closes #35.
1 parent 65453ba commit 3240ee1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,13 @@ loader.pitch = function(request) {
5151
namedChunkFilename: null
5252
};
5353

54+
const compilerOptions = this._compiler.options || {};
55+
if (compilerOptions.output && compilerOptions.output.globalObject==='window') {
56+
console.warn('Warning (workerize-loader): output.globalObject is set to "window". It should be set to "self" or "this" to support HMR in Workers.');
57+
}
58+
5459
worker.compiler = this._compilation.createChildCompiler('worker', worker.options);
55-
60+
5661
(new WebWorkerTemplatePlugin(worker.options)).apply(worker.compiler);
5762

5863
if (this.target!=='webworker' && this.target!=='web') {

0 commit comments

Comments
 (0)