Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use production React version for bundled overlay (facebook#3267)
* Use production React version

* We cannot strip our own checks if production

* Keep the sourcemap during minify

* Prevent devtools pollution

* Add some comments

* sigh
  • Loading branch information
Timer authored Oct 11, 2017
commit 991b092c893b916e6fd34e408e96a395d47b6008
3 changes: 1 addition & 2 deletions packages/react-error-overlay/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
],
"author": "Joe Haddad <[email protected]>",
"files": [
"lib/",
"middleware.js"
"lib/index.js"
],
"devDependencies": {
"anser": "1.4.1",
Expand Down
24 changes: 23 additions & 1 deletion packages/react-error-overlay/webpack.config.iframe.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
'use strict';

const path = require('path');
const webpack = require('webpack');

module.exports = {
devtool: 'cheap-module-source-map',
entry: './src/iframeScript.js',
output: {
path: path.join(__dirname, './lib'),
Expand All @@ -24,4 +24,26 @@ module.exports = {
},
],
},
plugins: [
new webpack.DefinePlugin({
// We set process.env.NODE_ENV to 'production' so that React is built
// in production mode.
'process.env': { NODE_ENV: '"production"' },
// This prevents our bundled React from accidentally hijacking devtools.
__REACT_DEVTOOLS_GLOBAL_HOOK__:
'__REACT_ERROR_OVERLAY_GLOBAL_HOOK_NOOP__',
}),
// This code is embedded as a string, so it would never be optimized
// elsewhere.
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false,
comparisons: false,
},
output: {
comments: false,
ascii_only: false,
},
}),
],
};
1 change: 0 additions & 1 deletion packages/react-error-overlay/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
const path = require('path');

module.exports = {
devtool: 'cheap-module-source-map',
entry: './src/index.js',
output: {
path: path.join(__dirname, './lib'),
Expand Down