Open moltar opened 1 year ago
tsup
: https://github.com/egoist/tsup/issues/571rollup-plugin-dts
: https://github.com/Swatinem/rollup-plugin-dts/issues/127you can work-around the below rollup.dts
options:
import { defineBuildConfig } from 'unbuild';
export default defineBuildConfig({
// ...
rollup: {
dts: {
compilerOptions: { composite: false }
}
},
// ...
});
recently, rollup-plugin-dts
issue has been updated
https://github.com/Swatinem/rollup-plugin-dts/issues/127#issuecomment-1983726767
Environment
Node v18.12.1 PNPM Workspace v8
Reproduction
This is not super obvious, and I can provide a repro on demand if this is a new and/or unknown scenario.
Describe the bug
composite: true
(it is being references by another)unbuild
get an error.Additional context
The files are listed in
includes
.Removing the
composite
flag makes the problem go away and build works fine.Same problem and solution are described on SO (not for
unbuild
in particular): https://stackoverflow.com/a/70964056/1566758Full tsconfig.json
```json { "compilerOptions": { "rootDir": "src", "outDir": "lib", "alwaysStrict": true, "declaration": true, "esModuleInterop": true, "experimentalDecorators": true, "inlineSourceMap": true, "inlineSources": true, "lib": [ "es2019" ], "module": "CommonJS", "noEmitOnError": true, "noFallthroughCasesInSwitch": true, "noImplicitAny": true, "noImplicitReturns": true, "noImplicitThis": true, "noUnusedLocals": true, "noUnusedParameters": true, "resolveJsonModule": true, "strict": true, "strictNullChecks": true, "strictPropertyInitialization": true, "stripInternal": true, "target": "ES2019", "incremental": true, "tsBuildInfoFile": "tsconfig", "skipLibCheck": true, "declarationMap": true, "emitDeclarationOnly": true }, "include": [ "src/**/*.ts" ], "exclude": [] } ```Diff that fixes the problem
```diff diff --git a/packages/projen-jest-swc/tsconfig.json b/packages/projen-jest-swc/tsconfig.json index 302b209..ffabb8e 100644 --- a/packages/projen-jest-swc/tsconfig.json +++ b/packages/projen-jest-swc/tsconfig.json @@ -29,7 +29,6 @@ "incremental": true, "tsBuildInfoFile": "tsconfig", "skipLibCheck": true, - "composite": true, "declarationMap": true, "emitDeclarationOnly": true }, ```Logs