Skip to content

Instantly share code, notes, and snippets.

@sainthkh
Created May 22, 2019 01:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sainthkh/0f1bfa3ae714b82d7caac8a602e82918 to your computer and use it in GitHub Desktop.
Save sainthkh/0f1bfa3ae714b82d7caac8a602e82918 to your computer and use it in GitHub Desktop.
Don't need gatsby-plugin-react-native-web. Just copy below to gatsby-node.js
const merge = require('webpack-merge')
exports.onCreateWebpackConfig = ({ actions, getConfig }) => {
const originalWebpackConfig = getConfig()
const reactNativeWebConfig = {
resolve: {
extensions: [
'.web.js',
'.js',
],
alias: {
'react-native$': 'react-native-web',
},
},
}
const newConfig = merge(reactNativeWebConfig, originalWebpackConfig)
actions.replaceWebpackConfig(newConfig)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment