-
Notifications
You must be signed in to change notification settings - Fork 27k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update with-react-native-web example to use babel (#6170)
Fixes #6138 Tested with both latest and 8.0.0-canary.17
- Loading branch information
1 parent
8b24103
commit dbdd663
Showing
3 changed files
with
20 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"presets": [ | ||
"next/babel" | ||
], | ||
"plugins": [ | ||
[ | ||
"module-resolver", | ||
{ | ||
"root": ["./"], | ||
"alias": { | ||
"^react-native$": "react-native-web" | ||
} | ||
} | ||
] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters