Skip to content

[Bug]: Favicon setting in html plugin does not work correctly when output.publicPath: "auto" #8412

@mochiya98

Description

@mochiya98

System Info

System Info
  System:
    OS: macOS 15.0
    CPU: (11) arm64 Apple M3 Pro
    Memory: 57.17 MB / 18.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 20.15.0 - ~/.anyenv/envs/nodenv/versions/20.15.0/bin/node
    Yarn: 1.22.22 - ~/.anyenv/envs/nodenv/versions/20.15.0/bin/yarn
    npm: 10.7.0 - ~/.anyenv/envs/nodenv/versions/20.15.0/bin/npm
    pnpm: 9.12.3 - /opt/homebrew/bin/pnpm
  Browsers:
    Chrome: 130.0.6723.117
    Edge: 130.0.2849.80
    Safari: 18.0
  npmPackages:
    @rspack/cli: ^1.1.0 => 1.1.0 
    @rspack/core: ^1.1.0 => 1.1.0 
    @rspack/plugin-react-refresh: 1.0.0 => 1.0.0 

Details

when output.publicPath:“auto”, the html plugin outputs the following tag:

<link href="dist/favicon.svg" rel="icon" />

but it should be as follows:

<link href="favicon.svg" rel="icon" />

Reproduce link

No response

Reproduce Steps

config like this:

{
  output: {
    publicPath: "auto"
  },
  plugins: [
    new rspack.HtmlRspackPlugin({
      favicon: "./src/favicon.svg",
    })
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpending triageThe issue/PR is currently untouched.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions