Expo is now rapidly adding support for the web platform. Although it's ready for production yet, it's worth exploring their cli to run and build web project rather than using our own custom framework. This will reduce maintenance overhead.
Strategy
This should be very straight forward as expo cli is already used to build react native projects. We may be able to use the same code with minor changes.
Command
Experimental support can be added via --expo flag. So final commands will be:
bluebase web:start --expo
bluebase web:build --expo
Prior Work
I've done a brief exploration of the issue without writing much code till now. Here are the findings:
- Custom
app.json can be used by using the --config flag on cli just like we do for native (This wasn't the case when I last tried a month ago).
- Custom Static Files are served from
web folder in root. This seems to be the code that does it. We need to find a way to change this behavior so that we can use BlueBase folder structure.
- Webpack Configs can be customized by putting a
webpack.config.js in the project root. We need to find a way to put this file in a child directory to follow BlueBase folder structure. This seems to be the code where expo cli imports the webpack configs.
Possible solutions to point 2 & 3:
- Use a custom projectRoot.
- Change working directory before executing expo CLI command
- Send them a PR to accept custom paths through app.json 🙃.
Expo is now rapidly adding support for the web platform. Although it's ready for production yet, it's worth exploring their cli to run and build web project rather than using our own custom framework. This will reduce maintenance overhead.
Strategy
This should be very straight forward as expo cli is already used to build react native projects. We may be able to use the same code with minor changes.
Command
Experimental support can be added via
--expoflag. So final commands will be:Prior Work
I've done a brief exploration of the issue without writing much code till now. Here are the findings:
app.jsoncan be used by using the--configflag on cli just like we do for native (This wasn't the case when I last tried a month ago).webfolder in root. This seems to be the code that does it. We need to find a way to change this behavior so that we can use BlueBase folder structure.webpack.config.jsin the project root. We need to find a way to put this file in a child directory to follow BlueBase folder structure. This seems to be the code where expo cli imports the webpack configs.Possible solutions to point 2 & 3: