Skip to content

Specifying minimize options for cssnano #414

Closed
@dkrutsko

Description

@dkrutsko

I believe there is a bug in the way that cssnano options are currently being passed into css-loader. According to the documentation it specifies that they should be loaded like so:

{
  test: /\.css$/,
  use: [
    {
      loader: 'css-loader',
      options: {
        minimize: true || {/* CSSNano Options */}
      }
    }
  ]
}

However, looking at the source code and testing it myself revealed that they actually have to be attached to the options object directly:

{
  test: /\.css$/,
  use: [
    {
      loader: 'css-loader',
      options: {
        /* CSSNano Options */
      }
    }
  ]
}

Should that code be query.minimize? or should the documentation be updated?

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