Skip to content
Discussion options

You must be logged in to vote

For larger MV3 projects, I usually separate the extension into feature-based folders instead of page-based folders.

For example:

src/
background/
content/
popup/
options/
shared/
utils/
storage/
messaging/
types/

A few practices that have helped:

  • Keep shared business logic in a shared folder so it can be reused by all extension contexts.
  • Create a small messaging wrapper instead of calling chrome.runtime.sendMessage() everywhere.
  • Centralize storage access in one module to avoid duplicated keys and logic.
  • Keep the service worker as lightweight as possible and move reusable code into shared modules.
  • Use TypeScript path aliases to simplify imports in larger projects.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected byRanaKafilAnwar
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GitHub EducationAll things GitHub Education including website, documentation and events.QuestionAsk and answer questions about GitHub features and usageVerification Help & GuidanceGuiding users through their Education verification rejection reasons.Welcome 🎉Used to greet and highlight first-time discussion participants. Welcome to the community!source:uiDiscussions created via Community GitHub templates
2 participants
@RanaKafilAnwar@ZaheerAhmedkhan65