Skip to content
This repository was archived by the owner on Feb 7, 2025. It is now read-only.
This repository was archived by the owner on Feb 7, 2025. It is now read-only.

API to allow other plugins to provide css to output asset #9

@jquense

Description

@jquense

This is partly an issue due to how Sapper extracts css so maybe better solved there (cc @benmccann)? I've been trying to write a rollup plugin that also transforms and concats individual css imported by JS. Something like css-modules and Sass (@tivac). The issue i've run into is there is no way to avoid having rollup-plugin-css-chunks re bundle css files i've already bundled together.

consider: files pre processed files in a chunk: A.mcss, B.mcss, C.mcss which get built into a single built.css. At the moment there is no mechanism to to have this plugin include built.css with all the other css files in the chunk and pass them them on to sapper. It gets specific to Sapper in that their splitting plugin looks in chunk.imports for files to include, however I can't add built.css to chunk.imports because css-chunks will turn it into a css @import which is unnecessary, and i can't insert my plugin after it b/c Sapper adds it.

I realize that a bunch of this is sapper specific, but my guess is the ultimate solution is probably here. Perhaps defining an interface via plugin meta to communicate new files (and the chunk they belong in)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions