···11+# @config/vite-base
22+33+Base configuration for Vite and Vitest.
44+55+## Installation
66+77+```bash
88+pnpm add -D @config/vite-base
99+```
1010+1111+## Usage
1212+1313+To use the base configuration in your vitest.config.ts:
1414+1515+```ts
1616+// vitest.config.ts
1717+import { createVitestConfig } from '@config/vite-base';
1818+1919+export default createVitestConfig({
2020+ // Your specific configuration
2121+});
2222+```
2323+2424+To use the base configuration in your vite.config.ts:
2525+2626+```ts
2727+// vite.config.ts
2828+import { createViteConfig } from '@config/vite-base';
2929+3030+export default createViteConfig({
3131+ // Your specific configuration
3232+ plugins: [react()], // Example
3333+});
3434+```
3535+3636+## Implementation
3737+3838+To complete the implementation of this package in the workspace:
3939+4040+1. Build the package:
4141+4242+ ```bash
4343+ cd packages/configs/vite-base
4444+ pnpm install
4545+ pnpm build
4646+ ```
4747+4848+2. Add it as a dependency to your packages:
4949+5050+ ```bash
5151+ cd <your-package>
5252+ pnpm add -D @config/vite-base@workspace:*
5353+ ```
5454+5555+3. Update your vitest.config.ts and vite.config.ts files to use the base configurations.
···11import { fileURLToPath } from 'node:url';
2233-import { defineConfig } from 'vitest/config';
33+import { createVitestConfig } from '@config/vite-base';
4455-export default defineConfig({
66- plugins: [],
77- test: {
88- // Dont run tests in parallel. This is to ensure the test server can start up.
99- // And that the port was not previously taken.
1010- fileParallelism: false,
1111- include: ['test/e2e/**/*.test.ts'],
1212- root: fileURLToPath(new URL('./', import.meta.url)),
55+export default createVitestConfig(
66+ fileURLToPath(new URL('./', import.meta.url)),
77+ {
88+ test: {
99+ // Dont run tests in parallel. This is to ensure the test server can start up.
1010+ // And that the port was not previously taken.
1111+ fileParallelism: false,
1212+ include: ['test/e2e/**/*.test.ts'],
1313+ },
1314 },
1414-});
1515+);