Skip to content

Commit

Permalink
Merge pull request #20313 from agarun/optimizedeps-combine
Browse files Browse the repository at this point in the history
builder-vite: Include user config `optimizeDeps` in final `optimizeDeps`
  • Loading branch information
yannbf authored Dec 19, 2022
2 parents 214ca75 + 586ebce commit a2b8fb9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion code/lib/builder-vite/src/optimizeDeps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,12 @@ export async function getOptimizeDeps(config: ViteInlineConfig, options: Extende
const include = await asyncFilter(INCLUDE_CANDIDATES, async (id) => Boolean(await resolve(id)));

const optimizeDeps: UserConfig['optimizeDeps'] = {
...config.optimizeDeps,
// We don't need to resolve the glob since vite supports globs for entries.
entries: stories,
// We need Vite to precompile these dependencies, because they contain non-ESM code that would break
// if we served it directly to the browser.
include,
include: [...include, ...(config.optimizeDeps?.include || [])],
};

return optimizeDeps;
Expand Down

0 comments on commit a2b8fb9

Please sign in to comment.