Enable output modules to be used in browser or Node (#1401)

This makes cli.js work again from the Node command line

Workaround from https://github.com/webpack/webpack/issues/6522
This commit is contained in:
Erik Demaine
2018-06-02 19:33:46 -04:00
committed by Kevin Barabash
parent 59a25fe3d9
commit 32fe81ae40

View File

@@ -57,6 +57,9 @@ function createConfig(target /*: Target */, dev /*: boolean */,
library: target.library,
libraryTarget: 'umd',
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",
path: path.resolve(__dirname, 'build'),
publicPath: dev ? '/' : '',
},