We need the ability to edit webpack settings, eg. alias and include features.
Or the web project can only run outside expo since we cannot edit the overide feature
Here are some codes that native-base-web need to override and include in order to work.
@txs If you want to over-ride webpack configuration in expo web. You can create a webpack.config.js file. But, I am not sure what things to override and how to do it. I am not good with webpack. I couldn’t find any way. here is the guide to override webpack config in expo web:
@txs if you are able to modify webpack configuration correctly to make nativebase work with expo-web.
Please share your webpack config file with me as well.
Not sure if this is definitely related but I’m also having issues getting my existing project to work with expo-web after updating to sdk33. It seems to be an error caused by native-base, output:
ProjectDir/node_modules/native-base-shoutem-theme/src/StyleProvider.js 10:19
Module parse failed: Unexpected token (10:19)
You may need an appropriate loader to handle this file type.
| */
| export default class StyleProvider extends React.Component {
> static propTypes = {
| children: PropTypes.element.isRequired,
| style: PropTypes.object,
I spoke with our expert on all things Expo-web, he updated the process/ corresponding doc, and as long you have the latest expo-CLI (npm i -g expo-cli) and run expo customize:web in your project then it should work.
add “@babel/plugin-transform-modules-commonjs” to babel plugins, or you will get
react-native-keyboard-aware-scroll-view/lib/KeyboardAwareHOC.js
Attempted import error: ‘react-native-web/dist/index’ does not contain a default export (imported as ‘ReactNative’).
You need to let babel know which libraries it should compile. It’ll automatically target anything starting with react-native, expo, @expo, @react-navigation, react-navigation.
Add the following to your app.json:
Oh yeah, this isn’t a great solution but figured enough people ran into the issue. Might even be easier if they also published under the alias “react-native-base”. If you guys run into libraries like this in the future please try PR’n them to that same location so it gets on my radar faster