diff --git a/packages/vitest-config/README.md b/packages/vitest-config/README.md index 8c8c247..867c40a 100644 --- a/packages/vitest-config/README.md +++ b/packages/vitest-config/README.md @@ -34,6 +34,9 @@ export { react as default } from '@apitree.cz/vitest-config'; ### Nest.js +⚠️ Nest.js projects are CJS by default, this configuration needs to be placed in `vitest.config.mjs` to interpret it as +ESM. + ```typescript export { nestjs as default } from '@apitree.cz/vitest-config'; ``` diff --git a/packages/vitest-config/package.json b/packages/vitest-config/package.json index c1beb84..e58859a 100644 --- a/packages/vitest-config/package.json +++ b/packages/vitest-config/package.json @@ -9,19 +9,12 @@ }, "sideEffects": false, "type": "module", - "exports": { - "import": "./dist/esm/index.js", - "require": "./dist/cjs/index.js" - }, - "main": "./dist/cjs/index.js", - "types": "./dist/esm/index.d.ts", + "exports": "./dist/index.js", "files": [ "dist" ], "scripts": { - "build": "run-p build:cjs build:esm", - "build:cjs": "tsc --project tsconfig.build.cjs.json", - "build:esm": "tsc --build tsconfig.build.json", + "build": "tsc --build tsconfig.build.json", "cleanup": "rimraf .eslintcache .turbo tsconfig.tsbuildinfo tsconfig.build.tsbuildinfo dist node_modules", "fix": "run-p ts format:fix lint:fix", "format": "prettier --check \"./**/*.{json,md}\"", diff --git a/packages/vitest-config/tsconfig.build.cjs.json b/packages/vitest-config/tsconfig.build.cjs.json deleted file mode 100644 index fb797cc..0000000 --- a/packages/vitest-config/tsconfig.build.cjs.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "composite": false, - "declaration": false, - "incremental": false, - "module": "commonjs", - "moduleResolution": "node", - "noEmit": false, - "outDir": "./dist/cjs", - "rootDir": "./src" - }, - "include": ["./src"] -} diff --git a/packages/vitest-config/tsconfig.build.json b/packages/vitest-config/tsconfig.build.json index 9a7f2df..4120149 100644 --- a/packages/vitest-config/tsconfig.build.json +++ b/packages/vitest-config/tsconfig.build.json @@ -2,9 +2,8 @@ "extends": "./tsconfig.json", "compilerOptions": { "noEmit": false, - "outDir": "./dist/esm", - "rootDir": "./src", - "tsBuildInfoFile": "tsconfig.build.tsbuildinfo" + "outDir": "./dist", + "rootDir": "./src" }, "include": ["./src"] }