VueDemi is a library that helps you create components that support both Vue 2 and Vue 3.
Here I show you how to test VueDemi for Vue 2 and Vue 3 using Vitest in a PNPM Workspace (Monorepo) environment configured with Turborepo.
packages/my-component
: A Component created using VueDemipackages/test-vue-2
: Running tests on Vue<=2.6
packages/test-vue-3
: Running tests on Vue>3.0
git clone https://github.com/Gumball12/vitest-vue-demi-pnpm-monorepo.git
cd vitest-vue-demi-pnpm-monorepo
pnpm install # install all dependencies
pnpm test-v2 # run tests for Vue <=2.6
pnpm test-v3 # run tests for Vue >=3.0
pnpm build # build my-component (Files built on `packages/my-component/dist/` are created)
MIT @Gumball12