Fix Webpack global function definition, including hot module replacement (#1435)

* Upgrade webpack-cli to 3.0.1

* Wrap output.globalObject in parentheses

Fix global function definition, such as hot module update.
This commit is contained in:
ylemkimon
2018-06-17 21:19:02 +09:00
committed by Erik Demaine
parent a7682e6220
commit 3f1b13e352
2 changed files with 2 additions and 2 deletions

View File

@@ -52,7 +52,7 @@
"uglifyjs-webpack-plugin": "^1.2.5",
"webpack": "^4.9.1",
"webpack-bundle-analyzer": "^2.13.0",
"webpack-cli": "^3.0.0",
"webpack-cli": "^3.0.1",
"webpack-dev-server": "^3.1.4"
},
"bin": "cli.js",

View File

@@ -59,7 +59,7 @@ function createConfig(target /*: Target */, dev /*: boolean */,
libraryExport: 'default',
// Enable output modules to be used in browser or Node.
// See: https://github.com/webpack/webpack/issues/6522
globalObject: "typeof self !== 'undefined' ? self : this",
globalObject: "(typeof self !== 'undefined' ? self : this)",
path: path.resolve(__dirname, 'build'),
publicPath: dev ? '/' : '',
},