[DevTools] Silence unactionable bundle warnings in shell (#34034)

This commit is contained in:
Sebastian "Sebbie" Silbermann
2025-07-29 11:18:47 +02:00
committed by GitHub
parent 5d7e8b90e2
commit 33a2bf78c4

View File

@@ -47,7 +47,31 @@ const E2E_APP_BUILD_DIR = process.env.REACT_VERSION
const makeConfig = (entry, alias) => ({
mode: __DEV__ ? 'development' : 'production',
devtool: __DEV__ ? 'cheap-source-map' : 'source-map',
stats: 'normal',
stats: {
preset: 'normal',
warningsFilter: [
warning => {
const message = warning.message;
// We use ReactDOM legacy APIs conditionally based on the React version.
// react-native-web also accesses legacy APIs statically but we don't end
// up using them at runtime.
return (
message.startsWith(
`export 'findDOMNode' (imported as 'findDOMNode') was not found in 'react-dom'`,
) ||
message.startsWith(
`export 'hydrate' (reexported as 'hydrate') was not found in 'react-dom'`,
) ||
message.startsWith(
`export 'render' (imported as 'render') was not found in 'react-dom'`,
) ||
message.startsWith(
`export 'unmountComponentAtNode' (imported as 'unmountComponentAtNode') was not found in 'react-dom'`,
)
);
},
],
},
entry,
output: {
publicPath: '/dist/',