Skip to content

publicPath escapes '@' character while emitting css files #15012

@jedrzejowski

Description

@jedrzejowski

Bug report

Hi, I'm developing chrome extension and in order to use images in CSS styles i need to set pubicPath to chrome-extension://__MSG_@@extension_id__/ (see why).

What is the current behavior?

For unknown reason CSS files are generated like this:

body {
    background: red;
    background-image: url(chrome-extension://__MSG_%40@extension_id__/895c2722a512d5b2e333.png);
/*                                                 ^^^                                           */
}

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

I prepared repository:

git clone [email protected]:jedrzejowski/my-issue-3.git webpack-issue-XXX
cd webpack-issue-XXX
npm ci
npx webpack
cat dist/index.css 

What is the expected behavior?

CSS file should look like this:

body {
    background: red;
    background-image: url(chrome-extension://__MSG_@@extension_id__/895c2722a512d5b2e333.png);
}

Other relevant information:
webpack version: 5.65.0, bug was introduced in version 5.52.0
Node.js version: 16/17
Operating System: Linux
Additional tools: none

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