WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

.css file with same name results in empty .js output #627

@silverwind

Description

@silverwind

Reproduction link or steps

  1. Clone https://github.com/silverwind/tsdown-multi
  2. Run npm i && npx tsdown

What is expected?

That both dist/index.js and dist/index.css contain the bundled code.

What is actually happening?

dist/index.js is generated with 0 bytes because the entry index.css apparently generates a second empty index.js which unexpectedly overwrites the existing index.js:

ℹ tsdown v0.17.0-beta.5 powered by rolldown v1.0.0-beta.52
ℹ config file: /Users/silverwind/git/tsdown-multi/tsdown.config.ts
ℹ entry: index.css
ℹ Build start
ℹ dist/index.js   0.00 kB │ gzip: 0.02 kB
ℹ dist/index.css  0.02 kB │ gzip: 0.04 kB
ℹ 2 files, total: 0.02 kB
✔ Build complete in 9ms

Any additional comments?

The same entry file configuration works with vite and rollup. I recommend for .css files to not generate useless empty .js output files.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions