Can't use without Expo...
lgxm3z opened this issue · comments
Lucas Gomes commented
Lucas Gomes commented
Quick Solution:
Use custom webpack config
https://www.gatsbyjs.com/docs/how-to/custom-configuration/add-custom-webpack-config/
Install
- react-native-web
- @types/react-native (If using TypeScript)
Create gatsby-node.js
📝
exports.onCreateWebpackConfig = ({stage, rules, loaders, plugins, actions}) => {
actions.setWebpackConfig({
resolve: {
alias: {
'react-native$': 'react-native-web'
},
extensions: ['.tsx', '.ts', '.jsx', '.js', '.web.tsx', '.web.ts', '.web.jsx', '.web.js']
}
});
};