Skip to content

No CSS in output with cssCodeSplit set to false #13620

Open
@dpmadden

Description

@dpmadden

I'm using React Router as a...

framework

Reproduction

  1. Set build.cssCodeSplit = false in vite config file
  2. Set ssr: false in react router config
  3. Run react-router build

See: https://stackblitz.com/edit/github-7jqksxm2

System Info

System:
    OS: Windows 11 10.0.26100
    CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12700H
    Memory: 13.46 GB / 31.68 GB
  Binaries:
    Node: 22.14.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 3.5.0 - C:\Program Files\nodejs\yarn.CMD
    npm: 11.1.0 - C:\Program Files\nodejs\npm.CMD
    pnpm: 7.30.3 - C:\Program Files\nodejs\pnpm.CMD
  Browsers:
    Edge: Chromium (135.0.3179.66)
    Internet Explorer: 11.0.26100.1882
  npmPackages:
    @react-router/dev: ^7.6.0 => 7.6.0
    @react-router/node: ^7.6.0 => 7.6.0
    react-router: ^7.6.0 => 7.6.0
    vite: ^6.3.5 => 6.3.5

Used Package Manager

npm

Expected Behavior

Stylesheet is appended to head of index.html output in SPA mode

Actual Behavior

No stylesheets anywhere. CSS files are in the assets directory, but there is no loading / reference to them in any way, shape or form.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions