Skip to content
This repository was archived by the owner on Aug 27, 2026. It is now read-only.
This repository was archived by the owner on Aug 27, 2026. It is now read-only.

Use output.cssFilename as default filename #1041

Closed

Description

@ahabhgk

Feature Proposal

Use output.cssFilename as default filename, I know cssFilename is used for experiments.css, but it would be great if it can also used for this plugin

Feature Use Case

module.exports = {
  output: {
    cssFilename: "[name]-[contenthash].css",
  },
  plugins: [new MiniCssExtractPlugin()]
}

Please paste the results of npx webpack-cli info here, and mention other relevant information

Activity

  1. alexander-akait commented on Jan 10, 2024

    @alexander-akait
    Member

    We can do it, but I am afraid it will be breaking change right now

  2. SukkaW commented on Dec 23, 2025

    @SukkaW
    Contributor

    @alexander-akait What about making config.output.cssFilename as a fallback?

    If the filename is passed to new MiniCssExtractPlugin({ filename }), it takes precedence, and we always use that, and config.output.cssFilename is ignored.

    And if config.output.cssFilename is specified, mini-css-extract-plugin can fallback to that.

    And if neither is specified, mini-css-extract-plugin falls back to the built-in default.

    If we always prefer filename is passed to new MiniCssExtractPlugin({ filename }) (the highest priority), this should avoid breaking existing users.

  3. alexander-akait commented on Dec 23, 2025

    @alexander-akait
    Member

    @SukkaW I am fine with it, but I would like to add experiments.css is mostly ready (around 95% things are implemented), so you can try to use built-in css solution (we are planning to finish it completely by January)

  4. SukkaW commented on Dec 23, 2025

    @SukkaW
    Contributor

    @SukkaW I am fine with it, but I would like to add experiments.css is mostly ready (around 95% things are implemented), so you can try to use built-in css solution (we are planning to finish it completely by January)

    My current use case is having a shared webpack config (doing something like module.exports = require('@acme/webpack').createWebpackConfig({ webpackExperimentalCss: boolean })) stuff, and I want to have multiple projects (no matter which css solution is used) with a consolidated cssFilename config in one place.

    As for this issue, I will create a PR implementing #1041 (comment) since you gave it a go.

  5. alexander-akait commented on Dec 23, 2025

    @alexander-akait
    Member

    @SukkaW Got it, I am fine with it, do you want to send a PR?

  6. added a commit that references this issue on Dec 24, 2025
  7. SukkaW commented on Dec 24, 2025

    @SukkaW
    Contributor
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

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions