rsnext/examples/with-react-native-web/next.config.js
Nishan 12597f2822
fix: add .web.jsx extension support (#32076)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-12-15 23:50:23 -06:00

17 lines
407 B
JavaScript

module.exports = {
webpack: (config) => {
config.resolve.alias = {
...(config.resolve.alias || {}),
// Transform all direct `react-native` imports to `react-native-web`
'react-native$': 'react-native-web',
}
config.resolve.extensions = [
'.web.js',
'.web.jsx',
'.web.ts',
'.web.tsx',
...config.resolve.extensions,
]
return config
},
}