sinha-rn-web v1.1.0
React Native Web CLI
This is Command Line tool to create a React Native Project with web support. By default react-native only initializes android and iOS support, but this CLI tool can be used to initialize a project with web support.
It uses conventional
npx react-native initcommand only to initialize React Native project, and then adds packages and files required forwebsupport.You can add
websupport to existing React Native projects too with this tool.It is not using
create-react-appto initializewebplatform, instead it is usingwebpackdirectly.It uses
react-native-webunder the hood
Commands
sinha-rn-web init
Use this command to initialize the project, it runs npx react-native@latest init command hence it will take few more time maybe few minutes to initialize project. It the adds support to the created project.
Use command below to initialize the app
npx sinha-rn-web@latest init MyTestAppsinha-rn-web add-web
This command adds web platform support to existing React Native projects, hence if you have an existing project then navigate to your project root and run the command below to add web support.
npx sinha-rn-web@latest add-webTesting and Building
Test
To test the web platform while development, run the command below in your project.
npm run webBuilding
To create production build of your project for web, run the command below.
npm run web-buildYou will get your production build in build folder in your project's web directory. Hence in ./web/build/