Skip to content

Commit

Permalink
react-devtools-core standalone bugfix: prevent electron crash
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Brian Vaughn committed Jul 26, 2019
1 parent 76c6739 commit 7385de9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion packages/react-devtools-core/webpack.standalone.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]',
},
Expand Down
2 changes: 1 addition & 1 deletion shells/browser/shared/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ module.exports = {
{
loader: 'css-loader',
options: {
sourceMap: true,
sourceMap: __DEV__,
modules: true,
localIdentName: '[local]___[hash:base64:5]',
},
Expand Down
2 changes: 1 addition & 1 deletion shells/dev/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const config = {
{
loader: 'css-loader',
options: {
sourceMap: true,
sourceMap: __DEV__,
modules: true,
localIdentName: '[local]___[hash:base64:5]',
},
Expand Down

0 comments on commit 7385de9

Please sign in to comment.