Skip to content

Allow to specify filename of emitted CSS when build.cssCodeSplit: false #4863

Closed
@vwkd

Description

Clear and concise description of the problem

When building in library mode for a .js file that imports styles, Vite generates a style.css file in the target directory alongside the .js file.

Using build.lib.fileName we can already specify the filename for the .js file. Currently there seems to be no way to specify the filename for the .css file, as it always defaults to style.css.

Suggested solution

Maybe a build.lib.fileNameCSS option?

Alternative

A workaround is renaming the style.css in a postbuild script. But this isn't ideal since it involves yet another build step, and doing it in Vite itself would be more coherent.

Additional context

No response

Validations

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions