Advanced patterns for v2 addons
summary
v2 addons are static npm packages using a pull-based v2 addons approach instead of V1’s push model, so nothing ships unless the app imports it. CSS and images are imported from the addon and an import yields a public, fingerprinted URL — with a webpack/Vite loader that returns a JS module exposing that URL (import returns fingerprinted URL). Lazy loading works by dynamic-importing addon modules (example: threejs scene becomes a separate chunk). Build-time processing ships as separate webpack/Vite loaders (example: responsive-image uses sharp and emits resized files). For conditional compile-time behavior use embroider macros: dependency-satisfies, import-sync which strip dead code.
AI-written summary · about
chapters (8)
- 0:00Introduction to V2 addons
- 6:54Pull-based vs push-based approach
- 7:14Importing CSS in V2 addons
- 10:06Importing static assets
- 14:43Lazy loading dependencies
- 28:22Build plugins for apps
- 34:23Embroider macros for dynamic code
- 38:00Resources and Q&A








