Repo: https://github.com/MartinMalinda/vue-concurrency
In my dist, besides the actual bundles, I also have a src folder with type files (index.d.ts, Task.d.ts and so on). That seems correct and much needed.
But besides that there's also typing being created for the whole __tests__ and test-utils folders and also there's jest.config.d.ts. These things probably shouldn't be included as part of the main bundle.
Is there a way to avoid it? Maybe it's some silly mistake on my side.
Thanks!
Ultimately that boils down to how TypeScript is configured in your project. From a quick glance it looks like everything will be compiled with TS and thus everything will get a definition file.
You can limit that to only the folders/files you want to be included by creating a separate tsconfig file for building.
{
"extends": "./tsconfig",
"exclude": ["**/*.test.ts", "**/*.mock.ts"]
}
And then specify that when running your build like so:
microbundle build --tsconfig tsconfig.build.json
The TypeScript team has a page in their docs about these fields.
thanks for the great answer, it makes total sense
Most helpful comment
Ultimately that boils down to how TypeScript is configured in your project. From a quick glance it looks like everything will be compiled with TS and thus everything will get a definition file.
You can limit that to only the folders/files you want to be included by creating a separate
tsconfigfile for building.And then specify that when running your build like so:
The TypeScript team has a page in their docs about these fields.