Delete empty chunks
- Dominant language
- TypeScript
- Stars
- 11.3k
- Forks
- 275
- PR merge metrics
- No merged PRs in 30d
Description
Hi, I've searched on GitHub and online, also around Rollup and Esbuild but couldn't find what I want so here I am.
In my project (https://github.com/op-ent/unstyled-ui), I have a folder per component (see `src/components`) that follows the structure:
```text
/Component
- Component.tsx
- Component.types.ts
- ...
```
The `Component.types.ts` file only contains types.
When building with tsup, empty chuncks are generated for such files:
```ts
// Button.types.mjs
```
```ts
// Button.types.mjs
"use strict";'use strict';
```
```ts
// Button.types.d.ts
import 'react';
import 'ts-essentials';
import '../../types/polymorphic.js';
export { c as ButtonComponent, B as ButtonCustomizableProps, a as ButtonLoadingOptions, b as ButtonProps, D as DefaultButtonProps } from '../../IconButton.types-8a550f35.js';
import '@zag-js/accordion';
```
So I'd like to get rid of the `.mjs` and `.ts` files automatically. I tried by renaming `Component.types.ts` to `Component.types.d.ts` but it didn't work.
How should I do? Thanks in advance for your answers.
Contributor guide
Assessment
This issue has not been assessed yet.