diff --git a/packages/kit/src/exports/vite/index.js b/packages/kit/src/exports/vite/index.js index 8da8f693b7a4..40be9fc452ff 100644 --- a/packages/kit/src/exports/vite/index.js +++ b/packages/kit/src/exports/vite/index.js @@ -293,7 +293,10 @@ async function kit({ svelte_config }) { cors: { preflightContinue: true } }, optimizeDeps: { - entries: [`${kit.files.routes}/**/+*.{svelte,js,ts}`, `!${kit.files.routes}/**/+*.server.{svelte,js,ts}`], + entries: [ + `${kit.files.routes}/**/+*.{svelte,js,ts}`, + `!${kit.files.routes}/**/+*server.{svelte,js,ts}` + ], exclude: [ '@sveltejs/kit', // exclude kit features so that libraries using them work even when they are prebundled diff --git a/packages/kit/test/apps/dev-only/test/test.js b/packages/kit/test/apps/dev-only/test/test.js index 346043f09d80..2897f73b42c7 100644 --- a/packages/kit/test/apps/dev-only/test/test.js +++ b/packages/kit/test/apps/dev-only/test/test.js @@ -107,16 +107,6 @@ test.describe('Vite', () => { expect(manifest).toHaveProperty('optimized.e2e-test-dep-page-universal'); }); - test('optimizes +page.server.js dependencies', async ({ page }) => { - await page.goto('/'); - await page.getByText('hello world!').waitFor(); - - const manifest_path = path.join(__dirname, '../node_modules/.vite/deps/_metadata.json'); - const manifest = JSON.parse(fs.readFileSync(manifest_path, 'utf-8')); - - expect(manifest).toHaveProperty('optimized.e2e-test-dep-page-server'); - }); - test('optimizes +layout.svelte dependencies', async ({ page }) => { await page.goto('/'); await page.getByText('hello world!').waitFor(); @@ -137,16 +127,6 @@ test.describe('Vite', () => { expect(manifest).toHaveProperty('optimized.e2e-test-dep-layout-universal'); }); - test('optimizes +layout.server.js dependencies', async ({ page }) => { - await page.goto('/'); - await page.getByText('hello world!').waitFor(); - - const manifest_path = path.join(__dirname, '../node_modules/.vite/deps/_metadata.json'); - const manifest = JSON.parse(fs.readFileSync(manifest_path, 'utf-8')); - - expect(manifest).toHaveProperty('optimized.e2e-test-dep-layout-server'); - }); - test('optimizes +error.svelte dependencies', async ({ page }) => { await page.goto('/'); await page.getByText('hello world!').waitFor();