Commit 944fd43
Conditionally import legacy-inspector-support per ember-source version
The min-supported try-scenario was failing with:
[vite]: Rollup failed to resolve import "@ember/enumerable/mutable"
from ".../@embroider/legacy-inspector-support/src/modules-4-12.js"
`@embroider/legacy-inspector-support` ships three entry points sharded by
ember-source range:
- ember-source-3.28 → Ember < 4.8 (uses legacy mutable-enumerable path)
- ember-source-4.8 → Ember 4.8–4.11 (adds @ember/enumerable/mutable)
- ember-source-4.12 → Ember >= 4.12 (also adds @ember/owner)
test-app/app/app.js was hard-coded to the 4.12 entry, so the min-supported
scenario (ember-source ~4.2.0) pulled in modules-4-12.js, which imports
`@ember/enumerable/mutable` — a module that doesn't exist in Ember 4.2.
Use macroCondition + dependencySatisfies + importSync from @embroider/macros
to pick the right entry at build time based on the installed ember-source.
The macros compile the untaken branches away, so each try scenario only
pulls in the import graph it can actually resolve.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>1 parent 1512bf9 commit 944fd43
1 file changed
Lines changed: 19 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
4 | 9 | | |
5 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
6 | 24 | | |
7 | 25 | | |
8 | 26 | | |
| |||
0 commit comments