Hello
How can we exclude files from compilation (for example test files ending with .spec.ts)? I tried #415 but it errored:
ESM Build failed
Error: Build failed with 1 error:
error: The entry point "./src/api.spec.ts" cannot be marked as external
Then I switched from using npx tsup src
to npx tsup src/index.ts
and I got an error that other files are imported but are not entrypoints.
src/index.ts(1,15): error TS6307: File '<redacted>/src/endpoints.ts' is not listed within the file list of project ''. Projects must list all files or use an 'include' pattern.
The file is in the program because:
Imported via './endpoints' from file '<redacted>/src/index.ts'
Imported via './endpoints' from file '<redacted>/api.ts'
src/index.ts(3,15): error TS6307: File '<redacted>/src/api.ts' is not listed within the file list of project ''. Projects must list all files or use an 'include' pattern.
Then I tried to "include" everything under "./src" in tsconfig.json, but it didn't help.
Then I tried to use the glob library to exactly specify my import files and exclude test files, but I don't think tsup supports asynchronous configs?
Is there a way to exclude files within the src directory (preferably without creating a node script that calls tsup's "build" directly)?
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too