From 8288ce6a507254ad0c185d743ebc22eafaa3c151 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BF=A0=20/=20green?= Date: Tue, 28 Mar 2023 17:37:38 +0900 Subject: [PATCH] test: don't share cacheDir among different configs (#12625) --- playground/assets/vite.config-relative-base.js | 1 + playground/assets/vite.config-runtime-base.js | 1 + playground/assets/vite.config-url-base.js | 1 + playground/css/vite.config-no-css-minify.js | 1 + playground/css/vite.config-relative-base.js | 1 + playground/lib/vite.dyimport.config.js | 1 + playground/lib/vite.nominify.config.js | 1 + playground/preload/vite.config-preload-disabled.ts | 1 + playground/preload/vite.config-resolve-deps.ts | 1 + playground/worker/vite.config-es.js | 1 + playground/worker/vite.config-iife.js | 1 + playground/worker/vite.config-relative-base.js | 1 + playground/worker/vite.config-sourcemap.js | 12 ++++++------ 13 files changed, 18 insertions(+), 6 deletions(-) diff --git a/playground/assets/vite.config-relative-base.js b/playground/assets/vite.config-relative-base.js index 50ee67b1b..a8d85cd5e 100644 --- a/playground/assets/vite.config-relative-base.js +++ b/playground/assets/vite.config-relative-base.js @@ -21,4 +21,5 @@ export default defineConfig({ testConfig: { baseRoute: '/relative-base/', }, + cacheDir: 'node_modules/.vite-relative-base', }) diff --git a/playground/assets/vite.config-runtime-base.js b/playground/assets/vite.config-runtime-base.js index 802807f73..2ac73c543 100644 --- a/playground/assets/vite.config-runtime-base.js +++ b/playground/assets/vite.config-runtime-base.js @@ -57,4 +57,5 @@ export default defineConfig({ } }, }, + cacheDir: 'node_modules/.vite-runtime-base', }) diff --git a/playground/assets/vite.config-url-base.js b/playground/assets/vite.config-url-base.js index bed30f8d1..c9cfd0b84 100644 --- a/playground/assets/vite.config-url-base.js +++ b/playground/assets/vite.config-url-base.js @@ -21,4 +21,5 @@ export default defineConfig({ testConfig: { baseRoute: '/url-base/', }, + cacheDir: 'node_modules/.vite-url-base', }) diff --git a/playground/css/vite.config-no-css-minify.js b/playground/css/vite.config-no-css-minify.js index 373aa9e51..dce4815a7 100644 --- a/playground/css/vite.config-no-css-minify.js +++ b/playground/css/vite.config-no-css-minify.js @@ -9,4 +9,5 @@ export default defineConfig({ minify: true, cssMinify: false, }, + cacheDir: 'node_modules/.vite-no-css-minify', }) diff --git a/playground/css/vite.config-relative-base.js b/playground/css/vite.config-relative-base.js index 50ee67b1b..a8d85cd5e 100644 --- a/playground/css/vite.config-relative-base.js +++ b/playground/css/vite.config-relative-base.js @@ -21,4 +21,5 @@ export default defineConfig({ testConfig: { baseRoute: '/relative-base/', }, + cacheDir: 'node_modules/.vite-relative-base', }) diff --git a/playground/lib/vite.dyimport.config.js b/playground/lib/vite.dyimport.config.js index d00c74024..dcd9588b5 100644 --- a/playground/lib/vite.dyimport.config.js +++ b/playground/lib/vite.dyimport.config.js @@ -11,4 +11,5 @@ export default defineConfig({ }, outDir: 'dist/lib', }, + cacheDir: 'node_modules/.vite-dyimport', }) diff --git a/playground/lib/vite.nominify.config.js b/playground/lib/vite.nominify.config.js index b1d530970..9090ff922 100644 --- a/playground/lib/vite.nominify.config.js +++ b/playground/lib/vite.nominify.config.js @@ -9,4 +9,5 @@ export default defineConfig({ outDir: 'dist/nominify', }, plugins: [], + cacheDir: 'node_modules/.vite-nominify', }) diff --git a/playground/preload/vite.config-preload-disabled.ts b/playground/preload/vite.config-preload-disabled.ts index 4f1c66741..e1a9f4f17 100644 --- a/playground/preload/vite.config-preload-disabled.ts +++ b/playground/preload/vite.config-preload-disabled.ts @@ -23,4 +23,5 @@ export default defineConfig({ }, modulePreload: false, }, + cacheDir: 'node_modules/.vite-preload-disabled', }) diff --git a/playground/preload/vite.config-resolve-deps.ts b/playground/preload/vite.config-resolve-deps.ts index 6a60567be..accc72a6e 100644 --- a/playground/preload/vite.config-resolve-deps.ts +++ b/playground/preload/vite.config-resolve-deps.ts @@ -38,4 +38,5 @@ export default defineConfig({ return { relative: true } }, }, + cacheDir: 'node_modules/.vite-resolve-deps', }) diff --git a/playground/worker/vite.config-es.js b/playground/worker/vite.config-es.js index 329377ee3..3c7bf2fca 100644 --- a/playground/worker/vite.config-es.js +++ b/playground/worker/vite.config-es.js @@ -44,4 +44,5 @@ export default vite.defineConfig({ }, }, ], + cacheDir: 'node_modules/.vite-es', }) diff --git a/playground/worker/vite.config-iife.js b/playground/worker/vite.config-iife.js index 6c240c2d8..59ab1ded5 100644 --- a/playground/worker/vite.config-iife.js +++ b/playground/worker/vite.config-iife.js @@ -47,4 +47,5 @@ export default vite.defineConfig({ }, }, plugins: [workerPluginTestPlugin()], + cacheDir: 'node_modules/.vite-iife', }) diff --git a/playground/worker/vite.config-relative-base.js b/playground/worker/vite.config-relative-base.js index 04dd9327d..4d02a3e79 100644 --- a/playground/worker/vite.config-relative-base.js +++ b/playground/worker/vite.config-relative-base.js @@ -46,4 +46,5 @@ export default vite.defineConfig({ }, }, ], + cacheDir: 'node_modules/.vite-relative-base', }) diff --git a/playground/worker/vite.config-sourcemap.js b/playground/worker/vite.config-sourcemap.js index 4d89ec4b5..5524dc2e8 100644 --- a/playground/worker/vite.config-sourcemap.js +++ b/playground/worker/vite.config-sourcemap.js @@ -12,10 +12,11 @@ export default (sourcemap) => { sourcemap = true } + const typeName = + typeof sourcemap === 'boolean' ? 'sourcemap' : 'sourcemap-' + sourcemap + return vite.defineConfig({ - base: `/iife-${ - typeof sourcemap === 'boolean' ? 'sourcemap' : 'sourcemap-' + sourcemap - }/`, + base: `/iife-${typeName}/`, resolve: { alias: { '@': __dirname, @@ -33,9 +34,7 @@ export default (sourcemap) => { }, }, build: { - outDir: `dist/iife-${ - typeof sourcemap === 'boolean' ? 'sourcemap' : 'sourcemap-' + sourcemap - }/`, + outDir: `dist/iife-${typeName}/`, sourcemap: sourcemap, rollupOptions: { output: { @@ -46,5 +45,6 @@ export default (sourcemap) => { }, }, plugins: [workerPluginTestPlugin()], + cacheDir: `node_modules/.vite-sourcemap-${typeName}`, }) }