Commit dbdd6639 authored by Benjamin Hanes's avatar Benjamin Hanes Committed by Tim Neutkens

Update with-react-native-web example to use babel (#6170)

Fixes https://github.com/zeit/next.js/issues/6138

Tested with both latest and 8.0.0-canary.17
parent 8b24103d
{
"presets": [
"next/babel"
],
"plugins": [
[
"module-resolver",
{
"root": ["./"],
"alias": {
"^react-native$": "react-native-web"
}
}
]
]
}
const withTM = require('next-plugin-transpile-modules') module.exports = {
module.exports = withTM({
transpileModules: ['react-native-web'],
webpack: config => { webpack: config => {
// Alias all `react-native` imports to `react-native-web` // Alias all `react-native` imports to `react-native-web`
config.resolve.alias = { config.resolve.alias = {
...(config.resolve.alias || {}),
'react-native$': 'react-native-web' 'react-native$': 'react-native-web'
} }
return config return config
} }
}) }
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
"start": "next start" "start": "next start"
}, },
"dependencies": { "dependencies": {
"babel-plugin-module-resolver": "^3.1.2",
"next": "latest", "next": "latest",
"next-plugin-transpile-modules": "^0.1.3",
"react": "^16.7.0", "react": "^16.7.0",
"react-art": "^16.5.2", "react-art": "^16.5.2",
"react-dom": "^16.7.0", "react-dom": "^16.7.0",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment