Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Nov 15, 2024
1 parent 7ffd206 commit 6cb2f2b
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 6 deletions.
2 changes: 0 additions & 2 deletions packages/vitest/src/node/plugins/optimizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ export function VitestOptimizer(): Plugin {
viteConfig.cacheDir,
)

// console.log("[vitest:normalize-optimizer]", [testConfig, viteConfig.cacheDir, webOptimizer.cacheDir, ssrOptimizer.cacheDir]);

viteConfig.cacheDir
= webOptimizer.cacheDir || ssrOptimizer.cacheDir || viteConfig.cacheDir
viteConfig.optimizeDeps = webOptimizer.optimizeDeps
Expand Down
4 changes: 0 additions & 4 deletions packages/vitest/src/node/plugins/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ export function resolveOptimizerConfig(
}
else {
const root = testConfig.root ?? process.cwd()
// const cacheDir
// = testConfig.cache !== false ? testConfig.cache?.dir : undefined
const currentInclude = testOptions.include || viteOptions?.include || []
const exclude = [
'vitest',
Expand All @@ -62,8 +60,6 @@ export function resolveOptimizerConfig(
)

newConfig.cacheDir = (testConfig.cache !== false && testConfig.cache?.dir) || VitestCache.resolveCacheDir(root, viteCacheDir, testConfig.name)
// newConfig.cacheDir
// = cacheDir ?? VitestCache.resolveCacheDir(root, cacheDir, testConfig.name)
newConfig.optimizeDeps = {
...viteOptions,
...testOptions,
Expand Down
1 change: 1 addition & 0 deletions test/config/test/cache.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ describe('with optimizer enabled', () => {
expect(stderr).toBe('')

const cachePath = ctx!.cache.results.getCachePath()
// TODO: should be node_modules/.vite-custom/vitest
const path = resolve(root, 'node_modules/.vite-custom/results.json')
expect(cachePath).toBe(path)
})
Expand Down

0 comments on commit 6cb2f2b

Please sign in to comment.