fix(build): add post-build script to fix HTML paths for Chrome extension

- Create scripts/fix-build-paths.js to convert absolute paths to relative
- Update build script to run fix-build-paths.js after plasmo build
- Add build:raw script for raw plasmo build without fix

Problem: Plasmo generates HTML with absolute paths (href="/file.css")
which causes ERR_FILE_NOT_FOUND in Chrome extensions.

Solution: Post-build script replaces /path with ./path
This commit is contained in:
API Test Bot 2026-02-04 10:18:20 +07:00
parent 70226171d8
commit 23cc09b1a7
2 changed files with 65 additions and 1 deletions

View file

@ -21,7 +21,8 @@
},
"scripts": {
"dev": "plasmo dev",
"build": "plasmo build",
"build": "plasmo build && node scripts/fix-build-paths.js",
"build:raw": "plasmo build",
"package": "plasmo package"
},
"dependencies": {