From 32fe81ae409e3e2287bdaedc00cfeb90166d046f Mon Sep 17 00:00:00 2001 From: Erik Demaine Date: Sat, 2 Jun 2018 19:33:46 -0400 Subject: [PATCH] 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 --- webpack.common.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/webpack.common.js b/webpack.common.js index c8f1961a..99ad3446 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -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 ? '/' : '', },