From 8b91062172ef3714cefd685dea5621cda4953b41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Rozs=C3=ADval?= Date: Thu, 2 Nov 2023 12:41:08 +0100 Subject: [PATCH] chore(vitest-config): simplify build back to ESM only --- packages/vitest-config/README.md | 3 +++ packages/vitest-config/package.json | 11 ++--------- packages/vitest-config/tsconfig.build.cjs.json | 14 -------------- packages/vitest-config/tsconfig.build.json | 5 ++--- 4 files changed, 7 insertions(+), 26 deletions(-) delete mode 100644 packages/vitest-config/tsconfig.build.cjs.json 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"] }