Skip to content

fix(types): include CSS entrypoints in PublicPath generation - #2150

Merged
aklinker1 merged 2 commits into
wxt-dev:mainfrom
dahomita:tamdang/fix/publicpath-css-entrypoints
Feb 22, 2026
Merged

aklinker1 merged 2 commits into
wxt-dev:mainfrom
dahomita:tamdang/fix/publicpath-css-entrypoints

Conversation

@dahomita

Copy link
Copy Markdown
Contributor

Overview

I picked this up as a follow-up to the discussion in #2142.

The goal is to ensure PublicPath typing matches actual generated outputs by including CSS entrypoints, so browser.runtime.getURL type checks are accurate for CSS assets as well as JS/HTML.

This updates path generation to map:

  • content-script-style -> .css
  • unlisted-style -> .css
  • everything else unchanged

I also added an e2e test in typescript-project.test.ts to assert CSS paths are present in generated .wxt/types/paths.d.ts (/plain.css and /content-scripts/overlay.css).

Manual Testing

  • pnpm test
  • I manually smoke-tested this in templates/vanilla by adding css entrypoints and confirming they were included in PublicPath

Related Issue

This PR closes #<issue_number>

@netlify

netlify Bot commented Feb 22, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for creative-fairy-df92c4 ready!

Name Link
🔨 Latest commit d1949b5
🔍 Latest deploy log https://app.netlify.com/projects/creative-fairy-df92c4/deploys/699b19524f4238000896ce09
😎 Deploy Preview https://deploy-preview-2150--creative-fairy-df92c4.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@PatrykKuniczak

Copy link
Copy Markdown
Collaborator

@dahomita But that's good idea to include all .css files to be accessible inside content script?

@pkg-pr-new

pkg-pr-new Bot commented Feb 22, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@wxt-dev/analytics

npm i https://pkg.pr.new/@wxt-dev/analytics@2150

@wxt-dev/auto-icons

npm i https://pkg.pr.new/@wxt-dev/auto-icons@2150

@wxt-dev/browser

npm i https://pkg.pr.new/@wxt-dev/browser@2150

@wxt-dev/i18n

npm i https://pkg.pr.new/@wxt-dev/i18n@2150

@wxt-dev/module-react

npm i https://pkg.pr.new/@wxt-dev/module-react@2150

@wxt-dev/module-solid

npm i https://pkg.pr.new/@wxt-dev/module-solid@2150

@wxt-dev/module-svelte

npm i https://pkg.pr.new/@wxt-dev/module-svelte@2150

@wxt-dev/module-vue

npm i https://pkg.pr.new/@wxt-dev/module-vue@2150

@wxt-dev/runner

npm i https://pkg.pr.new/@wxt-dev/runner@2150

@wxt-dev/storage

npm i https://pkg.pr.new/@wxt-dev/storage@2150

@wxt-dev/unocss

npm i https://pkg.pr.new/@wxt-dev/unocss@2150

@wxt-dev/webextension-polyfill

npm i https://pkg.pr.new/@wxt-dev/webextension-polyfill@2150

wxt

npm i https://pkg.pr.new/wxt@2150

commit: d1949b5

@codecov

codecov Bot commented Feb 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.46%. Comparing base (68fa36e) to head (d1949b5).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2150      +/-   ##
==========================================
+ Coverage   76.08%   76.46%   +0.38%     
==========================================
  Files         113      113              
  Lines        3048     3055       +7     
  Branches      682      686       +4     
==========================================
+ Hits         2319     2336      +17     
+ Misses        643      636       -7     
+ Partials       86       83       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aklinker1 aklinker1 added the pkg/wxt Includes changes to the `packages/wxt` directory label Feb 22, 2026
@aklinker1
aklinker1 merged commit 05e23e7 into wxt-dev:main Feb 22, 2026
17 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for helping make WXT better!

aklinker1 added a commit that referenced this pull request Feb 22, 2026
@dahomita

Copy link
Copy Markdown
Contributor Author

@dahomita But that's good idea to include all .css files to be accessible inside content script?

Good question @PatrykKuniczak ! This PR only updates TypeScript path generation (PublicPath) so valid CSS output paths are typed correctly for browser.runtime.getURL. It does not change web_accessible_resources behavior

@PatrykKuniczak

Copy link
Copy Markdown
Collaborator

@dahomita Yeah, i've forgot about web_accessible_resource

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg/wxt Includes changes to the `packages/wxt` directory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants