Quick answer
TL;DR
| Problem | Two independently-built Vue apps plus a webpack-built block, all needing the same shared components, without drifting onto different copies of them |
| What I did | Matched path aliases across both Vite configs, let Tailwind scan the shared library per app, and reverted to plain CSS where utility classes stopped being readable |
| Why it mattered | An import means the same thing no matter which app it's written in, and each app still ships only the CSS its own pages actually use |
| Team | Solo |
The problem
A consistent alias convention
- @components and @icons resolve to the top-level src/components and src/icons folders
- @utils resolves to src/utilities
- @admin/@frontend let either app reach into the other's source when it needs to
- @assets, @routes, @store, @model, and @views are app-relative in both configs, pointing at each app's own local subfolder of the same name, so the alias shape is identical even though the target is local per app
- What matters is that the aliases both apps do share resolve to the same place, so import { Select } from '@components' means the identical file in either app
Tailwind scanning the shared library
Where Tailwind wasn't the answer
FAQ
Part of the A Shared Component Architecture for a WordPress Booking Plugin series →