wxt-dev / wxt-dev/wxt

Content Script CSS is added twice to build output

Open
#1,987 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

contribution welcome good first issue
Dominant language
TypeScript
Stars
10.5k
Forks
564
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the attached archive or a vanilla template containing entrypoints/example.css imported by content.ts, installing dependencies with npm first. Run npm run build or npm run zip and inspect the .output directory, comparing the content-scripts/content.css and assets/example.css files. Done means the imported CSS is present only once in the build output and zip.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.