You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am manually injecting a CSS file located within entrypoints/
entrypoints/content.ts
import"./some.css";// if the above line isn't included, then a change in that file will not trigger a reload// if the above line is included, then a change in that file will trigger a reload, but not update the contents of the css file// to actually update the css, you have to quit wxt entirely and start a new dev serverexportdefaultdefineContentScript({matches: ['*://example.com/*'],cssInjectionMode: "manual",// this line doesn't seem to make a difference, unless the lines 12-17 are commented out, in which case it prevents styles from being injectedmain(){console.log('Hello content.');// if the below lines are commented out (and line 9, css injection mode), the issue is fixed// let link = document.createElement("link");// link.rel = "stylesheet";// link.href = browser.runtime.getURL("/assets/some.css" as any);// link.classList.add("schooltape");// document.head.appendChild(link);},});
modify entrypoints/some.css - extension reloads but styles are not changed
It doesn't seem to have any effect on whether the css file is explicitly imported into the content script or not, only that the extension only reloads if there is a change and the css file has been imported by the content script. Is this intended behaviour? as the css file is located within entrypoints/
Steps to reproduce
built files are located in dist/ of the repo provided above (output of pnpm dev)
42willow
changed the title
CSS changes are not detected when manually injecting
CSS changes are not detected when manually injecting (HMR?)
Nov 1, 2024
Describe the bug
I am manually injecting a CSS file located within
entrypoints/
entrypoints/content.ts
May be related to #386
Reproduction
pnpm install
pnpm run dev
entrypoints/some.css
- extension reloads but styles are not changedIt doesn't seem to have any effect on whether the css file is explicitly imported into the content script or not, only that the extension only reloads if there is a change and the css file has been imported by the content script. Is this intended behaviour? as the css file is located within
entrypoints/
Steps to reproduce
built files are located in
dist/
of the repo provided above (output ofpnpm dev
)System Info
System: OS: Linux 6.6 NixOS 24.11 (Vicuna) 24.11 (Vicuna) CPU: (8) x64 Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz Memory: 9.29 GB / 15.26 GB Container: Yes Shell: 0.98.0 - /run/current-system/sw/bin/nu Binaries: Node: 20.17.0 - /etc/profiles/per-user/willow/bin/node npm: 10.8.2 - /etc/profiles/per-user/willow/bin/npm pnpm: 9.10.0 - /etc/profiles/per-user/willow/bin/pnpm bun: 1.1.29 - /etc/profiles/per-user/willow/bin/bun Browsers: Chromium: 129.0.6668.89 npmPackages: wxt: ^0.19.11 => 0.19.11
Used Package Manager
pnpm
Validations
The text was updated successfully, but these errors were encountered: