Skip to content

Content Script CSS is added twice to build output #1987

@DanielGekeler

Description

@DanielGekeler

Describe the bug

When adding a content css file to the entrypoints dir and importing it in content.ts, it get's included twice in the build output and builded zip. Once under .output/chrome-mv3/content-scripts/content.css and .output/chrome-mv3/assets/example.css. Both files have the same content.

Reproduction

Archive.zip

Steps to reproduce

Build the project included in the attached zip file. node_modules is not included requiring npm i to install the dependencies. Look at the .output directory.

Alternatively, create a new project with the vanilla template. Add a file named example.css in the entrypoints directory and import it in the content.ts file as follows: import "./example.css".
Execute npm run build or npm run zip and inspect the output folder.
Both files .output/chrome-mv3/content-scripts/content.css and .output/chrome-mv3/assets/example.css have the same contents as entrypoints/example.css

System Info

System:
    OS: Linux 6.17 Arch Linux
    CPU: (12) x64 AMD Ryzen 5 3600 6-Core Processor
    Memory: 9.88 GB / 15.56 GB
    Container: Yes
    Shell: 4.2.1 - /usr/bin/fish
  Binaries:
    Node: 25.2.1 - /usr/bin/node
    Yarn: 1.22.22 - /usr/bin/yarn
    npm: 11.6.4 - /usr/bin/npm
    Deno: 2.5.6 - /usr/bin/deno
  Browsers:
    Chromium: 142.0.7444.175
    Firefox: 145.0.2
    Firefox Developer Edition: 145.0.2
  npmPackages:
    wxt: ^0.20.6 => 0.20.11

Used Package Manager

npm

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    pending-triageSomeone (usually a maintainer) needs to look into this to see if it's a bug

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions