Created
May 22, 2019 01:11
-
-
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
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
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