Skip to content

Commit

Permalink
chore(vitest-config): simplify build back to ESM only
Browse files Browse the repository at this point in the history
  • Loading branch information
rozsival committed Nov 2, 2023
1 parent 1358251 commit 8b91062
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 26 deletions.
3 changes: 3 additions & 0 deletions packages/vitest-config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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';
```
Expand Down
11 changes: 2 additions & 9 deletions packages/vitest-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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}\"",
Expand Down
14 changes: 0 additions & 14 deletions packages/vitest-config/tsconfig.build.cjs.json

This file was deleted.

5 changes: 2 additions & 3 deletions packages/vitest-config/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}

0 comments on commit 8b91062

Please sign in to comment.