diff --git a/examples/with-react-native-web/next.config.js b/examples/with-react-native-web/next.config.js index 70dc75a1b21969f..cb7efa483410d26 100644 --- a/examples/with-react-native-web/next.config.js +++ b/examples/with-react-native-web/next.config.js @@ -1,11 +1,16 @@ module.exports = { - webpack: (config, { defaultLoaders }) => { + 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.push('.web.js', '.web.ts', '.web.tsx') + config.resolve.extensions = [ + '.web.js', + '.web.ts', + '.web.tsx', + ...config.resolve.extensions, + ] return config }, }