Skip to content

url options is Function, don't work #1255

Closed
@noshower

Description

@noshower
  • Operating System: macOS Catalina 10.15.7
  • Node Version: v14.14.0
  • NPM Version: 6.14.8
  • webpack Version: 5.20.2
  • css-loader Version: 5.0.1

my css-loader config:

 options: {
    url: (url) => {
      console.log('url', url);
      return !url.startsWith('/guide/img')
    },
    modules: {
      localIdentName: '[path][name]__[local]--[hash:base64:5]'
    }
  }

Expected Behavior

background-image: url("/guide/img/banWord/addCoinDialogTitleBg.png");

expected : this url dont resolve. because this is http url 。full url likes "http://domain.com/guide/img/banWord/addCoinDialogTitleBg.png"

Actual Behavior

this url resolve. but, throw error 'Error: Can't resolve 'guide/img/banWord/addCoinDialogTitleBg.png''

Other

I found url funciton was never called.

it sees like a bug.

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