Reproduction link or steps
https://stackblitz.com/edit/github-on9qlarn?file=dist%2Fstyle.css
- Minimal package.json with
@tsdown/css and tsdown installed
- empty
index.ts
style.css that imports from arbitrary content in ./theme.css:
@source "../index.ts";
@import "./theme.css";
tsdown.config.ts that makes ./src/assets/style.css an entrypoint / exposed to the bundler
What is expected?
According to https://tsdown.dev/options/css,
All imported CSS is bundled into a single output file with @import statements removed.
Meaning there should be no @import ./theme.css present in the bundled style.css.
What is actually happening?
The local import is still present, meaning the browser raises errors when actually importing the stylesheet:
/* contents of dist/style.css */
@source "../index.ts";
@import './theme.css';
Any additional comments?
If we swap the statement order (e.g., place @import before @source), everything works as expected and the import statement is not present in the output.
Reproduction link or steps
https://stackblitz.com/edit/github-on9qlarn?file=dist%2Fstyle.css
@tsdown/cssandtsdowninstalledindex.tsstyle.cssthat imports from arbitrary content in./theme.css:tsdown.config.tsthat makes./src/assets/style.cssan entrypoint / exposed to the bundlerWhat is expected?
According to https://tsdown.dev/options/css,
Meaning there should be no
@import ./theme.csspresent in the bundledstyle.css.What is actually happening?
The local import is still present, meaning the browser raises errors when actually importing the stylesheet:
Any additional comments?
If we swap the statement order (e.g., place
@importbefore@source), everything works as expected and the import statement is not present in the output.