egoist / tsup

The simplest and fastest way to bundle your TypeScript libraries.
https://tsup.egoist.dev
MIT License
8.48k stars 209 forks source link

Multiple empty lines in generated CJS file before the export statement, while exports are collapsed to one line #1068

Open OzelotVanilla opened 6 months ago

OzelotVanilla commented 6 months ago

I discovered there is empty lines before the exports statements in the generated CJS file. All the exports statement will be placed in one line.

Here are some examples:

2 exports, 3 empty line after previous non-empty. image

3 exports, 4 empty line after previous non-empty. image

7 exports, 8 empty line after previous non-empty. image

I am using the config like this:

import type { Options } from 'tsup';

const tsup_config: Options = {
    splitting: true,
    clean: true,
    dts: true,
    format: ["esm", "cjs"],
    bundle: false,
    skipNodeModulesBundle: true,
    target: 'esnext',
    outDir: 'dist',
    entry: ['src/**/*.ts']
};

export default tsup_config

Can I ask is this behaviour a bug, or designed to be like this, or if there is a failure in my configuration ?

Upvote & Fund

Fund with Polar