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.
This commit is contained in:
Brian Vaughn 2019-07-26 10:13:07 -07:00
parent 76c67399db
commit 7385de9fc2
3 changed files with 7 additions and 3 deletions

View File

@ -57,7 +57,11 @@ module.exports = {
{
loader: 'css-loader',
options: {
sourceMap: true,
// WARNING It's important that we disable CSS source maps for production builds.
// This causes style-loader to insert styles via a <style> tag rather than URL.createObjectURL,
// which in turn avoids a nasty Electron/Chromium bug that breaks DevTools in Nuclide.
// (Calls to URL.createObjectURL seem to crash the webview process.)
sourceMap: __DEV__,
modules: true,
localIdentName: '[local]___[hash:base64:5]',
},

View File

@ -59,7 +59,7 @@ module.exports = {
{
loader: 'css-loader',
options: {
sourceMap: true,
sourceMap: __DEV__,
modules: true,
localIdentName: '[local]___[hash:base64:5]',
},

View File

@ -57,7 +57,7 @@ const config = {
{
loader: 'css-loader',
options: {
sourceMap: true,
sourceMap: __DEV__,
modules: true,
localIdentName: '[local]___[hash:base64:5]',
},