Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vite failing to optimize some dependencies of direct addons #1583

Open
void-mAlex opened this issue Aug 22, 2023 · 2 comments
Open

vite failing to optimize some dependencies of direct addons #1583

void-mAlex opened this issue Aug 22, 2023 · 2 comments

Comments

@void-mAlex
Copy link
Collaborator

tried to see how far I can get with running vite in our app and I ran into a few instances that required me to specify in vite.config

optimizeDeps: {
  include: ['ember-intl > fast-memoize', 'miragejs > lodash.assign'] 
}

in order to have vite server actual ESM to the browser when the respective modules are requested.

this may be related to those addons being in rewritten-packages thus under a level of /mode_modules/ thus somehow hidden from the normal pre-bundling

@mansona
Copy link
Member

mansona commented Aug 30, 2023

This was caused by the fact that we are excluding the addons from optimizeDeps in this line https://github.com/embroider-build/embroider/blob/main/tests/vite-app/vite.config.mts#L26-L28

We need to not do that, and was there to workaround something (not exactly sure what 😂 )

@mansona
Copy link
Member

mansona commented Sep 8, 2023

Just to update on this: our current thinking is that we shouldn't ignore all addons, but instead just @embroider/macros

you can update your viteconfig to express this but we ultimately plan to provide a function from embroider that provides the whole optimizeDeps object so that we can include or exclude dependencies we would need to over time 👍

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

No branches or pull requests

2 participants