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

Is there any plan to update css-loader to v2 ? #14

@HiroshiOHSUGA

Description

@HiroshiOHSUGA

Recently css-loader was updated to v2 with breaking changes.

Important change is resolving logic for url(......).

resolving logic for uls() and import at-rules works the same everywhere, it does not matter whether css modules are enabled (with global and local module) or not. Examples - url('image.png') as require('./image.png'), url('./image.png') as require('./image.png'), url('~module/image.png') as require('module/image.png')

They says if we used assets from webpack aliased path, we should use ~ prefix.
But css-loader v1 can't resolve its path.

Do you have any plan for css-loader v2 ?

Note: Because there is workaround, this issue's priority may not be high.
Following settings don't work.

module.exports = {
  module: {
    rules: [
      {
        test: /\.css$/,
        loader: 'css-loader',
        options: {
          url: () => true, // <- keep resolving logic same to css-loader v1
        },
      },
    ],
  },
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions