embroider-build / embroider

Compiling Ember apps into spec-compliant, modern Javascript.
MIT License
330 stars 137 forks source link

vite: do not optimize dynamic addons #1850

Open patricklx opened 2 months ago

patricklx commented 2 months ago

with dynamic addons I mean addons which override the treeFor methods. they can potentially depend on app tree and rebuild whenever an app file changes. e.g ember-svg-jar, ember-cli-addon-docs.

With dep optimization that will not be updated. they need to be excluded

patricklx commented 1 month ago

I actually have to re verify this with #1876 first if this is still an issue. Maybe i only had bad dep optimizer issues.

Can v2 addons also override trees? Then they also would need this. The issue was currently with v1 addons that merge into themselves the app tree and do some app files processing. They create new files or recreate files based on app filed during dev. And if they are optimized, vite wouldn't re-optimize them. But that's also an issue without dynamic addons. Vite wouldn't optimize when a previous unused dep was imported during development

NullVoxPopuli commented 1 month ago

Can v2 addons also override trees?

they cannot :tada: