Skip to content

fix: include pre-built extension dist so Chrome can load it#90

Closed
Astro-Han wants to merge 1 commit intojackwener:mainfrom
Astro-Han:worktree-fix-extension-dist
Closed

fix: include pre-built extension dist so Chrome can load it#90
Astro-Han wants to merge 1 commit intojackwener:mainfrom
Astro-Han:worktree-fix-extension-dist

Conversation

@Astro-Han
Copy link
Contributor

Summary

  • Root cause: both .gitignore (dist/) and extension/.gitignore (dist/) excluded extension/dist/background.js, but manifest.json references it as the service worker — Chrome fails to load the extension
  • Change .gitignore from dist/ to /dist/ so it only ignores the root dist directory
  • Remove dist/ from extension/.gitignore and commit the pre-built extension/dist/background.js
  • Track extension/pnpm-lock.yaml for reproducible builds

Follow-up suggestion: consider adding a CI step that rebuilds the extension and runs git diff --exit-code extension/dist/ to catch source/dist drift.

Fixes #88

Test plan

  • Clone the repo, load extension/ as unpacked extension in Chrome — should load without errors
  • Run cd extension && pnpm build — verify dist/background.js is regenerated and matches the committed version

The extension manifest.json references dist/background.js, but both
the root .gitignore and extension/.gitignore excluded dist/, so the
built file was never shipped in the repo or npm package.

- Change root .gitignore from `dist/` to `/dist/` (root-only)
- Remove `dist/` from extension/.gitignore
- Commit the built extension/dist/background.js
- Track extension/pnpm-lock.yaml for reproducible builds

Fixes jackwener#88
@jackwener jackwener closed this Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Chrome 未能成功加载扩展程序

2 participants