-
-
Notifications
You must be signed in to change notification settings - Fork 265
Open
Description
Description:
I'm working in a monorepo setup. In my package, I have the following structure:
package
├── src/
│ ├── index.ts
│ └── ref.ts
├── package.json
├── tsconfig.json
My tsconfig.json includes:
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"composite": true,
"rootDir": "./src",
"moduleResolution": "node",
"outDir": "dist"
},
"include": ["src/**/*"]
}My build script in package.json is:
"build": "tsup src/index.ts --clean --format cjs,esm --dts --tsconfig ./tsconfig.json"When I run npm run build, I get the following error:
error TS6307: File '/package/src/ref.ts' is not listed within the file list of project ''. Projects must list all files or use an 'include' pattern.
However, running npx tsc -p tsconfig.json works perfectly and generates the expected declaration files.
What I've tried:
- Changing
moduleResolutionbetweennodeandbundler - Adjusting the
includepattern - Cleaning the
distand.tsbuildinfofiles - Upgrading
tsupandtypescript - Restarting VS Code
Expected behavior:
tsup should build the package and generate declaration files without TS6307 errors, just like tsc does.
Actual behavior:
tsup fails with TS6307, but tsc works.
Environment:
- tsup version: v8.5.0
- typescript version: v5.9.2
- Node.js version: v22.19.0
Additional context:
Is there a workaround or recommended way to use tsup for both JS and declaration file generation in this scenario?
Metadata
Metadata
Assignees
Labels
No labels