slorber / gatsby-plugin-react-native-web

react-native-web plugin for Gatsby
https://sebastienlorber.com/using-expo-in-gatsby
MIT License
277 stars 30 forks source link

Can't use without Expo... #122

Open lgxm3z opened 1 year ago

lgxm3z commented 1 year ago

image

lgxm3z commented 1 year ago

Quick Solution:

Use custom webpack config https://www.gatsbyjs.com/docs/how-to/custom-configuration/add-custom-webpack-config/

Install

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']
    }
  });
};