Reproduction link or steps
minimal reproduction: https://stackblitz.com/edit/github-2dddpu9g?file=src%2Findex.ts
- run
npm run build
- examine output asset in
dist/index.js
- notice:
- the contents of
style.css are inlined (as expected, this is correct)
- the contents of
jodit/es2021/jodit.css are not inlined (not expected, this is the bug)
-
What is expected?
I would expect when ?inline is added to the import statement the contents of the file are inlined as a string and assigned to the import variable.
What is actually happening?
In tsdown, the import is being processed as a regular js import statement instead of an instruction to inline the css file as a string.
Any additional comments?
I have prepared the exact same case in Vite 8 library mode (same source files, same tsconfig) to show how it functions in comparison.
https://stackblitz.com/edit/vitejs-vite-2v5kn8ki?file=src%2Findex.ts
- run
npm run build
- examine output asset in
dist/index.js
- notice:
- the contents of
style.css are inlined (as expected)
- the contents of
jodit/es2021/jodit.css are also inlined (as expected).
-
Reproduction link or steps
minimal reproduction: https://stackblitz.com/edit/github-2dddpu9g?file=src%2Findex.ts
npm run builddist/index.jsstyle.cssare inlined (as expected, this is correct)jodit/es2021/jodit.cssare not inlined (not expected, this is the bug)What is expected?
I would expect when
?inlineis added to the import statement the contents of the file are inlined as a string and assigned to the import variable.What is actually happening?
In
tsdown, the import is being processed as a regular js import statement instead of an instruction to inline the css file as a string.Any additional comments?
I have prepared the exact same case in Vite 8 library mode (same source files, same tsconfig) to show how it functions in comparison.
https://stackblitz.com/edit/vitejs-vite-2v5kn8ki?file=src%2Findex.ts
npm run builddist/index.jsstyle.cssare inlined (as expected)jodit/es2021/jodit.cssare also inlined (as expected).