-
-
Notifications
You must be signed in to change notification settings - Fork 109
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
refactor: use vitefu to handle svelte libraries #478
Conversation
Is vitefu using the exact same createRequire approach to resolve package.json paths? if not this could be a breaking change if it ends up resolving something differently. |
Currently the only difference is that vitefu uses Other than that, I don't think there's anything else different. The naming conventions such as |
i'll try to add a testcase, afterwards its good to go |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added testcase is still failing in dev for a cjs dependency that is not optimized and during build cjs ends up in the output. build passes but browser fails.
const svelteImportsToInclude = SVELTE_IMPORTS.filter((x) => x !== 'svelte/ssr'); // not used on clientside | ||
log.debug( | ||
`adding bare svelte packages to optimizeDeps.include: ${svelteImportsToInclude.join(', ')} ` | ||
); | ||
include.push(...svelteImportsToInclude.filter((x) => !isIncluded(x))); | ||
include.push(...svelteImportsToInclude); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: I removed this filter as it's fine to include duplicate identifiers
I may have butchered a few debug logs but I'm not sure if there were helpful recently 😬 Tried to preserve most of the code structure as before so it's easier to review.