emit_dts in svelte-kit package should respect the file excludes config
See original GitHub issueDescribe the problem
It’s fantastic that automatic type generation is included with the package
command, however it seems svelte2tsx
doesn’t accept any other configuration besides the lib root directory so when the types are generated with svelte-kit package
, all files get generated types.
This is not desired when .stories.svelte
, .test.ts
or .test.svelte
files (files that help test slots as a workaround) are next to the .svelte
files in the lib
directory.
Describe the proposed solution
It would be great to have the file excludes respected during type generation. I understand that it might be svelte2tsx
that needs to be altered to make this work.
Alternatives considered
For now I think I’ll include a post-package
script that cleans up files that match the glob in excludes
. It’s a hacky workaround, why generate files that need to be cleaned up, right?
Importance
would make my life easier
Additional Information
No response
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:7 (5 by maintainers)
Ok I think you convinced me. Generated d.ts files for files that are excluded would make you assume that these files exist when really they don’t. If this breaks you package then your
excludes
is wrong. So if you want you can go ahead and create a PR for this. I’ll maybe look into this some time next week.Emitted declarations should not get included when the source file is excluded in
.156
and above.