egoist / tsup

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

Final bundled .mjs file to include multiple imports from the same package #1028

Open pkasarda opened 11 months ago

pkasarda commented 11 months ago

Is it normal for the final bundled .mjs file to include multiple imports from the same package? Here's what I'm seeing:

import { someFn } from 'package1'
// ... some core
import { someFn as someFn1 } from 'package1'
// ... some core
import { someFn as someFn2 } from 'package1'

Is this the normal behavior, or is there a way to have a single import at the top for the same someFn from package1?

Originally posted by @pedropmedina in https://github.com/egoist/tsup/discussions/812

Upvote & Fund

Fund with Polar