Skip to content

Content hashes change based on entry order #281

Closed
@lfre

Description

@lfre

Compiling scss to css, I noticed that the contenthash on files changed when a new entry was added before, even though the content of the files have not changed. Without this plugin, the contenthash in the JS files remain the same regardless of order, which tells me it's not webpack, or sass-loader.

Any help is appreciated. Find the minimal reproduce scenario below:

Node: 8.12.0 (LTS)
Plugin: 0.4.3
css-loader: 1.0.0
sass-loader: 7.1.0
Webpack: 4.19.1

  entry: {
    file1: './file1.scss'
    file2: './file2.scss', // When commented out, the contenthash for all entries after (file3.[contenthash].css), will change regardless if the content has changed.
    file3: './file3.scss' 
  },
  output: {
	path: resolve('./'),
  },
  plugins: [
    new MiniCssExtractPlugin({
      filename: '[name].[contenthash].css',
    }),
  ],
  module: {
    rules: [
      {
        test: /\.scss$/,
        use: [
          {
            loader: MiniCssExtractPlugin.loader,
          },
          {
            loader: 'css-loader',
          },
          {
            loader: 'sass-loader',
          },
        ],
      },
    ],
  },

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions