Skip to content

External CSS assets not being inlined when imported via ?inline #959

Closed

Description

@compass-vin

Reproduction link or steps

minimal reproduction: https://stackblitz.com/edit/github-2dddpu9g?file=src%2Findex.ts

  • run npm run build
  • examine output asset indist/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)
    • Image

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 indist/index.js
  • notice:
    • the contents of style.css are inlined (as expected)
    • the contents of jodit/es2021/jodit.css are also inlined (as expected).
    • Image

Activity

  1. added theissue type on May 25, 2026
  2. reopened this on Sep 7, 2026
  3. added
    bugSomething isn't working
    on Oct 28, 2026
  4. sxzz commented on Oct 28, 2026

    @sxzz
    Member

    Fixed in #1109 (75a78ce): ?inline CSS imported from a dependency is now embedded as a string instead of being left as an external import. Explicit deps.neverBundle patterns still keep it external.

    The fix will ship in the next release after v0.23.3. Thanks for the clear comparison with Vite!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcss

    Type

    Fields

    Priority

    None yet

    Effort

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions