Skip to content

Commit 33a2bf7

Browse files
authored
[DevTools] Silence unactionable bundle warnings in shell (facebook#34034)
1 parent 5d7e8b9 commit 33a2bf7

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

packages/react-devtools-shell/webpack-server.js

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,31 @@ const E2E_APP_BUILD_DIR = process.env.REACT_VERSION
4747
const makeConfig = (entry, alias) => ({
4848
mode: __DEV__ ? 'development' : 'production',
4949
devtool: __DEV__ ? 'cheap-source-map' : 'source-map',
50-
stats: 'normal',
50+
stats: {
51+
preset: 'normal',
52+
warningsFilter: [
53+
warning => {
54+
const message = warning.message;
55+
// We use ReactDOM legacy APIs conditionally based on the React version.
56+
// react-native-web also accesses legacy APIs statically but we don't end
57+
// up using them at runtime.
58+
return (
59+
message.startsWith(
60+
`export 'findDOMNode' (imported as 'findDOMNode') was not found in 'react-dom'`,
61+
) ||
62+
message.startsWith(
63+
`export 'hydrate' (reexported as 'hydrate') was not found in 'react-dom'`,
64+
) ||
65+
message.startsWith(
66+
`export 'render' (imported as 'render') was not found in 'react-dom'`,
67+
) ||
68+
message.startsWith(
69+
`export 'unmountComponentAtNode' (imported as 'unmountComponentAtNode') was not found in 'react-dom'`,
70+
)
71+
);
72+
},
73+
],
74+
},
5175
entry,
5276
output: {
5377
publicPath: '/dist/',

0 commit comments

Comments
 (0)