egoist / egoist/tsup

Delete empty chunks

Open
#774 0 comments 1 reaction 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.