Skip to content

CSS output filename should not be tied to JS format #779

Description

@rschristian

Excluding v0.13.0 (due to the issue outlined in #776 & #777), Microbundle can end up using the JS format in the CSS file's name. For example, imagine I have the following keys in my package.json:

{
  "main": "dist/index.js",
  "module": "dist/index.module.js",
  "exports": "dist/index.modern.js",
  "umd:main": "dist/index.umd.js",
}

If I were to run Microbundle with microbundle build -f modern, then only index.modern.js will be in my output, but also causes index.modern.css to be generated. In most cases this likely wouldn't be an issue, as if I was targeting only modern I'd likely have it represented by index.js (remove the modern specifier altogether) but it is a side case that can emerge.

This is less than ideal as it's pointless in the case of Modern & UMD; confusing in the case of ESM as index.module.css does carry a different meaning.

Should be simple enough to edit the extract logic for rollup-plugin-postcss.

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions