diff --git a/examples/with-react-native-web/.babelrc b/examples/with-react-native-web/.babelrc new file mode 100644 index 000000000000..17b0e38c0259 --- /dev/null +++ b/examples/with-react-native-web/.babelrc @@ -0,0 +1,16 @@ +{ + "presets": [ + "next/babel" + ], + "plugins": [ + [ + "module-resolver", + { + "root": ["./"], + "alias": { + "^react-native$": "react-native-web" + } + } + ] + ] +} diff --git a/examples/with-react-native-web/next.config.js b/examples/with-react-native-web/next.config.js index 5a81404072ea..71384c084809 100644 --- a/examples/with-react-native-web/next.config.js +++ b/examples/with-react-native-web/next.config.js @@ -1,13 +1,11 @@ -const withTM = require('next-plugin-transpile-modules') - -module.exports = withTM({ - transpileModules: ['react-native-web'], +module.exports = { webpack: config => { // Alias all `react-native` imports to `react-native-web` config.resolve.alias = { + ...(config.resolve.alias || {}), 'react-native$': 'react-native-web' } return config } -}) +} diff --git a/examples/with-react-native-web/package.json b/examples/with-react-native-web/package.json index 6f1b2c0cc17a..1a7233cb2d44 100644 --- a/examples/with-react-native-web/package.json +++ b/examples/with-react-native-web/package.json @@ -6,8 +6,8 @@ "start": "next start" }, "dependencies": { + "babel-plugin-module-resolver": "^3.1.2", "next": "latest", - "next-plugin-transpile-modules": "^0.1.3", "react": "^16.7.0", "react-art": "^16.5.2", "react-dom": "^16.7.0",