react-devtools-core standalone bugfix: prevent electron crash
CSS source maps require the style-loader to use URL.createObjectURL (rather than just a <style> tag). For some reason, this crashes Electron's webview process, which completely breaks the embedded extension inside of Nuclide and other Electron apps. This commit turns (CSS) source maps off for production builds to avoid this crash.
Brian Vaughn committed
Jul 26, 2019 at 10:13 UTC
7385de9fc233cc78572951bb26055e996823bc44
3 files changed
+7
-3
packages/react-devtools-core/webpack.standalone.js
+5
-1
@@ -57,7 +57,11 @@ module.exports = {
57
{
58
loader: 'css-loader',
59
options: {
60
- sourceMap: true,
60
+ // WARNING It's important that we disable CSS source maps for production builds.
61
+ // This causes style-loader to insert styles via a <style> tag rather than URL.createObjectURL,
62
+ // which in turn avoids a nasty Electron/Chromium bug that breaks DevTools in Nuclide.
63
+ // (Calls to URL.createObjectURL seem to crash the webview process.)
64
+ sourceMap: __DEV__,
65
modules: true,
66
localIdentName: '[local]___[hash:base64:5]',
67
},
shells/browser/shared/webpack.config.js
+1
-1
@@ -59,7 +59,7 @@ module.exports = {
59
{
60
loader: 'css-loader',
61
options: {
62
- sourceMap: true,
62
+ sourceMap: __DEV__,
63
modules: true,
64
localIdentName: '[local]___[hash:base64:5]',
65
},
shells/dev/webpack.config.js
+1
-1
@@ -57,7 +57,7 @@ const config = {
57
{
58
loader: 'css-loader',
59
options: {
60
- sourceMap: true,
60
+ sourceMap: __DEV__,
61
modules: true,
62
localIdentName: '[local]___[hash:base64:5]',
63
},