This example is using nuxt-extend
and nuxt components
to create a multi-variant mobile/desktop nuxt application.
- Using yarn workspaces for mono-repo managenment
- Most of the logic is shared in base package
- Using two sperate builds ensures that there are no additional dependencies leaked between mobile and desktop variants
- Install dependencies with
yarn
- Use
yarn dev:desktop
andyarn dev:mobile
- Build with
yarn build:desktop
andyarn build:mobile
- Deploy each app to a subdomain
- Add any common nuxt module and config to base (base/nuxt.config)
- Avoid adding mobile/desktop specific modules, plugins and css
- Instead use desktop/nuxt.config and mobile/nuxt.config
Only base/pages and base/layouts directories are supported.
We use named components to implement them per-variant.
Only base/store directory is supported.
It is best to write shared logic inside vuex store modules.
It is recommended to use scoped styles. But in case that need to use global styles,
they can be included in layout component or nuxt.config
of each variant.
Also for component libraries, you can include their module in each variant.