From 92e716dd2334c77a7b846f2c4fdf71dbe4f10e9f Mon Sep 17 00:00:00 2001 From: Will O'Beirne Date: Fri, 6 Apr 2018 11:46:21 -0400 Subject: [PATCH] Fix workers on dev from HMR idiocy. --- webpack_config/makeConfig.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/webpack_config/makeConfig.js b/webpack_config/makeConfig.js index e858049d7eb..41f794fbf9c 100644 --- a/webpack_config/makeConfig.js +++ b/webpack_config/makeConfig.js @@ -280,7 +280,9 @@ module.exports = function(opts = {}) { path: path.resolve(config.path.output, options.outputDir), filename: options.isProduction ? `[name].${commitHash}.js` : '[name].js', publicPath: isDownloadable && options.isProduction ? './' : '/', - crossOriginLoading: 'anonymous' + crossOriginLoading: 'anonymous', + // Fix workers & HMR https://github.com/webpack/webpack/issues/6642 + globalObject: options.isProduction ? undefined : 'self' }; // The final bundle