Skip to content

CSS entry file builds an empty JS file #492

@kirk-loretz-fsn

Description

@kirk-loretz-fsn

Describe the regression

A .css entry point (in build.rollupOptions.input) builds a useless .js file containing only a comment. It seems like this happens only when the .css file is also imported in a .js file.

Reproduction

https://github.com/kirk-loretz-fsn/bug-rolldown-vite-css-entry

Expected Behavior

Rollup vite does not build a .js file for the .css file. The manifest.json says that the "file" for "src/style.css" is a .css file.

Actual Behavior

rolldown-vite builds a useless .js file containing only a comment. The manifest.json says that the "file" for "src/style.css" is this .js file.

Steps to Reproduce

  1. Build with rollup vite.

    pnpm install
    
    pnpm build
  2. Then, build with rolldown-vite.

    pnpm add -D vite@npm:rolldown-vite@7.2.0
    
    pnpm build

System Info

System:
    OS: Linux 6.14 Linux Mint 22 (Wilma)
    CPU: (16) x64 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz
    Memory: 38.32 GB / 62.52 GB
    Container: Yes
    Shell: 5.2.21 - /bin/bash
  Binaries:
    Node: 22.21.1 - /usr/bin/node
    npm: 11.6.2 - /usr/bin/npm
    pnpm: 10.20.0 - /usr/bin/pnpm
  Browsers:
    Chrome: 142.0.7444.134
    Firefox: 144.0.2
    Firefox Developer Edition: 144.0.2
  npmPackages:
    vite: 7.2.0 => 7.2.0

Used Package Manager

pnpm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug: upstreamBug in a dependency of Vite

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions