unbuild icon indicating copy to clipboard operation
unbuild copied to clipboard

commonjs plugin should not include .ts extension

Open juetan opened this issue 1 year ago • 3 comments

Environment

node 20

Reproduction

no

Describe the bug

in /src/builder/rollup.ts file, commonjs should not include .ts extension, is that expected? image

Additional context

No response

Logs

No response

juetan avatar May 08 '24 11:05 juetan

no (reproduction please)

pi0 avatar May 08 '24 15:05 pi0

no (reproduction please)

https://stackblitz.com/edit/vitejs-vite-z6f6jw?file=build.config.ts

when declaration: true, it build fail. then add rollup.commonjs.extensions,it works.

juetan avatar May 09 '24 01:05 juetan

Thanks for the reproduction. It seems the issue is with dts build step (since we bundle, usually importing ts in cjs context should be also doable)

pi0 avatar May 09 '24 16:05 pi0