Monorepo demos (Snowpack/Vite)
Tools used:
Run the demo
git clone <repo>
yarn # or `yarn install`
Build the UI Library
yarn ui build # build the ui library
Run the Snowpack demo
yarn app dev # run the app in dev mode
Run the UI storybook
yarn ui storybook # run the app in dev mode
Run the Vite demo
yarn vite:react dev
Important Notes
- the ui lib is exported as ESModules (checkout the tsconfig.build.json file)
- the app is created with the create-snowpack-app react-typescript template
- both projects are connected via yarn workspaces
- there's an issue while running a lib like this inside snowpack that are fixed with a hack in the index.html file by adding the next code:
<script>
global = globalThis //<- this should be enough
</script>
- more info about the issue here and here.
Acknowledgements
- Kudos to Kevin who is working together in a project using this setup and fix all the issues with me. thanks bro!!
- also thanks to the Snowpack and Stitches community, the support received from those were very important for us!
Any questions please reach out in twitter!