(entry, alias)
| 45 | : builtModulesDir; |
| 46 | |
| 47 | const makeConfig = (entry, alias) => ({ |
| 48 | mode: __DEV__ ? 'development' : 'production', |
| 49 | devtool: __DEV__ ? 'cheap-source-map' : 'source-map', |
| 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 | }, |
| 75 | entry, |
| 76 | output: { |
| 77 | publicPath: '/dist/', |
| 78 | }, |
| 79 | node: { |
| 80 | global: false, |
| 81 | }, |
| 82 | resolve: { |
| 83 | alias, |
| 84 | }, |
| 85 | optimization: { |
| 86 | minimize: false, |
| 87 | }, |
| 88 | plugins: [ |
| 89 | new Webpack.ProvidePlugin({ |
| 90 | process: 'process/browser', |
| 91 | }), |
| 92 | new Webpack.DefinePlugin({ |
| 93 | __DEV__, |
| 94 | __EXPERIMENTAL__: true, |
| 95 | __EXTENSION__: false, |
| 96 | __PROFILE__: false, |
| 97 | __TEST__: NODE_ENV === 'test', |
| 98 | 'process.env.GITHUB_URL': `"${GITHUB_URL}"`, |
| 99 | 'process.env.EDITOR_URL': EDITOR_URL != null ? `"${EDITOR_URL}"` : null, |
| 100 | 'process.env.DEVTOOLS_PACKAGE': `"react-devtools-shell"`, |
| 101 | 'process.env.DEVTOOLS_VERSION': `"${DEVTOOLS_VERSION}"`, |
| 102 | 'process.env.E2E_APP_REACT_VERSION': `"${REACT_VERSION}"`, |
| 103 | }), |
| 104 | ], |
no test coverage detected