Skip to content

bug: chunkhash changes for js when css was changed #7138

@alexander-akait

Description

@alexander-akait

Do you want to request a feature or report a bug?

bug

What is the current behavior?

I use https://github.com/webpack-contrib/mini-css-extract-plugin with options

new ExtractCSSPlugin({
      chunkFilename: '`[name]-[contenthash].chunk.css'
      filename: '[name]-[contenthash].css'
})

And

output: {
    chunkFilename: '[name]-[chunkhash].chunk.js',
    filename: '[name]-[chunkhash].js',
  }

for long term caching.
When i change something in js only chunkhash changes (i.e. all works as expected).
When i change something in css chunkhash for js changes, but js content is same and chunkhash should not changes.

If the current behavior is a bug, please provide the steps to reproduce.

  1. Create simple config with options above.
  2. Add js entry point.
  3. Inside js entry point import css file.
  4. Change something in js and look on chunkhash
  5. Change something in css and look what chunkhash changes.

What is the expected behavior?

chunkhash should not changes when i something change in css.

If this is a feature request, what is motivation or use case for changing the behavior?

Please mention other relevant information such as the browser version, Node.js version, webpack version, and Operating System.

[email protected] and [email protected]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions