Skip to content

Commit

Permalink
fix: avoid optimize-deps entries in vitest (#147)
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanPiercey authored Aug 26, 2024
1 parent 038c902 commit e1df4f2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/new-goats-relate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@marko/vite": patch
---

Avoid setting optimizeDeps entries in vitest.
14 changes: 8 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,12 +275,14 @@ export default function markoPlugin(opts: Options = {}): vite.Plugin[] {
}

const optimizeDeps = (config.optimizeDeps ??= {});
optimizeDeps.entries ??= [
"**/*.marko",
"!**/__snapshots__/**",
`!**/__tests__/**`,
`!**/coverage/**`,
];
if (!isTest) {
optimizeDeps.entries ??= [
"**/*.marko",
"!**/__snapshots__/**",
`!**/__tests__/**`,
`!**/coverage/**`,
];
}

const domDeps = compiler.getRuntimeEntryFiles("dom", opts.translator);
optimizeDeps.include = optimizeDeps.include
Expand Down

0 comments on commit e1df4f2

Please sign in to comment.