diff options
Diffstat (limited to 'packages')
22 files changed, 48 insertions, 62 deletions
diff --git a/packages/astro/e2e/fixtures/tailwindcss/package.json b/packages/astro/e2e/fixtures/tailwindcss/package.json index 5435bbc34..ab69e74fb 100644 --- a/packages/astro/e2e/fixtures/tailwindcss/package.json +++ b/packages/astro/e2e/fixtures/tailwindcss/package.json @@ -6,7 +6,7 @@ "@astrojs/tailwind": "workspace:*", "astro": "workspace:*", "autoprefixer": "^10.4.20", - "postcss": "^8.4.47", + "postcss": "^8.4.49", "tailwindcss": "^3.4.14" } } diff --git a/packages/astro/package.json b/packages/astro/package.json index 718b5ac13..961c04c43 100644 --- a/packages/astro/package.json +++ b/packages/astro/package.json @@ -167,8 +167,8 @@ "ultrahtml": "^1.5.3", "unist-util-visit": "^5.0.0", "vfile": "^6.0.3", - "vite": "6.0.0-beta.6", - "vitefu": "^1.0.3", + "vite": "^6.0.1", + "vitefu": "^1.0.4", "which-pm": "^3.0.0", "xxhash-wasm": "^1.0.2", "yargs-parser": "^21.1.1", @@ -215,7 +215,7 @@ "sass": "^1.80.6", "undici": "^6.20.1", "unified": "^11.0.5", - "vitest": "^2.1.1" + "vitest": "^2.1.6" }, "engines": { "node": "^18.17.1 || ^20.3.0 || >=21.0.0", diff --git a/packages/astro/src/core/create-vite.ts b/packages/astro/src/core/create-vite.ts index 11804e5ca..7b680c405 100644 --- a/packages/astro/src/core/create-vite.ts +++ b/packages/astro/src/core/create-vite.ts @@ -216,7 +216,6 @@ export async function createVite( replacement: 'astro/components', }, ], - conditions: ['astro'], // Astro imports in third-party packages should use the same version as root dedupe: ['astro'], }, diff --git a/packages/astro/src/vite-plugin-astro/index.ts b/packages/astro/src/vite-plugin-astro/index.ts index 1214467e2..21d9dcfb1 100644 --- a/packages/astro/src/vite-plugin-astro/index.ts +++ b/packages/astro/src/vite-plugin-astro/index.ts @@ -8,7 +8,7 @@ import type { CompileMetadata, } from './types.js'; -import { normalizePath } from 'vite'; +import { defaultClientConditions, defaultServerConditions, normalizePath } from 'vite'; import type { AstroConfig } from '../types/public/config.js'; import { hasSpecialQueries, normalizeFilename } from '../vite-plugin-utils/index.js'; import { type CompileAstroResult, compileAstro } from './compile.js'; @@ -43,6 +43,18 @@ export default function astro({ settings, logger }: AstroPluginOptions): vite.Pl const prePlugin: vite.Plugin = { name: 'astro:build', enforce: 'pre', // run transforms before other plugins can + async configEnvironment(name, viteConfig, opts) { + viteConfig.resolve ??= {}; + // Emulate Vite default fallback for `resolve.conditions` if not set + if (viteConfig.resolve.conditions == null) { + if (viteConfig.consumer === 'client' || name === 'client' || opts.isSsrTargetWebworker) { + viteConfig.resolve.conditions = [...defaultClientConditions]; + } else { + viteConfig.resolve.conditions = [...defaultServerConditions]; + } + } + viteConfig.resolve.conditions.push('astro'); + }, configResolved(viteConfig) { // Initialize `compile` function to simplify usage later compile = (code, filename) => { diff --git a/packages/astro/test/config-vite.test.js b/packages/astro/test/config-vite.test.js index abf2d71bc..90d3487f9 100644 --- a/packages/astro/test/config-vite.test.js +++ b/packages/astro/test/config-vite.test.js @@ -1,7 +1,7 @@ import assert from 'node:assert/strict'; import { before, describe, it } from 'node:test'; import * as cheerio from 'cheerio'; -import { resolveConfig } from 'vite'; +import { defaultClientConditions, resolveConfig } from 'vite'; import { getViteConfig } from '../dist/config/index.js'; import { loadFixture } from './test-utils.js'; @@ -28,9 +28,12 @@ describe('getViteConfig', () => { it('Does not change the default config.', async () => { const command = 'serve'; const mode = 'test'; - const configFn = getViteConfig({}); + const configFn = getViteConfig({}, { logLevel: 'silent' }); const config = await configFn({ command, mode }); const resolvedConfig = await resolveConfig(config, command, mode); - assert.deepStrictEqual(resolvedConfig.resolve.conditions, ['astro']); + assert.deepStrictEqual(resolvedConfig.resolve.conditions, [ + ...defaultClientConditions, + 'astro', + ]); }); }); diff --git a/packages/astro/test/fixtures/postcss/package.json b/packages/astro/test/fixtures/postcss/package.json index 492521464..70c447080 100644 --- a/packages/astro/test/fixtures/postcss/package.json +++ b/packages/astro/test/fixtures/postcss/package.json @@ -8,7 +8,7 @@ "@astrojs/vue": "workspace:*", "astro": "workspace:*", "autoprefixer": "^10.4.20", - "postcss": "^8.4.47", + "postcss": "^8.4.49", "solid-js": "^1.9.3", "svelte": "^5.1.16", "vue": "^3.5.12" diff --git a/packages/astro/test/fixtures/tailwindcss-ts/package.json b/packages/astro/test/fixtures/tailwindcss-ts/package.json index 25c78b3f1..bf18b54b7 100644 --- a/packages/astro/test/fixtures/tailwindcss-ts/package.json +++ b/packages/astro/test/fixtures/tailwindcss-ts/package.json @@ -5,7 +5,7 @@ "dependencies": { "@astrojs/tailwind": "workspace:*", "astro": "workspace:*", - "postcss": "^8.4.47", + "postcss": "^8.4.49", "tailwindcss": "^3.4.14" } } diff --git a/packages/astro/test/fixtures/tailwindcss/package.json b/packages/astro/test/fixtures/tailwindcss/package.json index cf1d7a985..fb19d2c5d 100644 --- a/packages/astro/test/fixtures/tailwindcss/package.json +++ b/packages/astro/test/fixtures/tailwindcss/package.json @@ -7,7 +7,7 @@ "@astrojs/tailwind": "workspace:*", "astro": "workspace:*", "autoprefixer": "^10.4.20", - "postcss": "^8.4.47", + "postcss": "^8.4.49", "tailwindcss": "^3.4.14" } } diff --git a/packages/astro/test/fixtures/vitest/package.json b/packages/astro/test/fixtures/vitest/package.json index c2919c61a..ee32c2b33 100644 --- a/packages/astro/test/fixtures/vitest/package.json +++ b/packages/astro/test/fixtures/vitest/package.json @@ -8,6 +8,6 @@ }, "dependencies": { "astro": "workspace:*", - "vitest": "^2.1.1" + "vitest": "^2.1.6" } } diff --git a/packages/db/package.json b/packages/db/package.json index d513c4d0b..748b6cac3 100644 --- a/packages/db/package.json +++ b/packages/db/package.json @@ -91,6 +91,6 @@ "astro-scripts": "workspace:*", "cheerio": "1.0.0", "typescript": "^5.6.3", - "vite": "6.0.0-beta.6" + "vite": "^6.0.1" } } diff --git a/packages/db/test/fixtures/ticketing-example/package.json b/packages/db/test/fixtures/ticketing-example/package.json index 478a0ebac..061cc3348 100644 --- a/packages/db/test/fixtures/ticketing-example/package.json +++ b/packages/db/test/fixtures/ticketing-example/package.json @@ -12,7 +12,7 @@ "@astrojs/check": "^0.9.4", "@astrojs/db": "workspace:*", "@astrojs/node": "^8.3.4", - "@astrojs/react": "^3.6.2", + "@astrojs/react": "workspace:*", "@types/react": "^18.3.12", "@types/react-dom": "^18.3.1", "astro": "workspace:*", diff --git a/packages/integrations/alpinejs/package.json b/packages/integrations/alpinejs/package.json index 5c506688e..acce2b85d 100644 --- a/packages/integrations/alpinejs/package.json +++ b/packages/integrations/alpinejs/package.json @@ -41,7 +41,7 @@ "@playwright/test": "1.48.2", "astro": "workspace:*", "astro-scripts": "workspace:*", - "vite": "6.0.0-beta.6" + "vite": "^6.0.1" }, "publishConfig": { "provenance": true diff --git a/packages/integrations/markdoc/package.json b/packages/integrations/markdoc/package.json index 1c3ec68ee..08c9b816e 100644 --- a/packages/integrations/markdoc/package.json +++ b/packages/integrations/markdoc/package.json @@ -79,7 +79,7 @@ "astro-scripts": "workspace:*", "devalue": "^5.1.1", "linkedom": "^0.18.5", - "vite": "6.0.0-beta.6" + "vite": "^6.0.1" }, "engines": { "node": "^18.17.1 || ^20.3.0 || >=21.0.0" diff --git a/packages/integrations/mdx/package.json b/packages/integrations/mdx/package.json index fe59d20f3..00e5598d5 100644 --- a/packages/integrations/mdx/package.json +++ b/packages/integrations/mdx/package.json @@ -70,7 +70,7 @@ "remark-toc": "^9.0.0", "shiki": "^1.22.2", "unified": "^11.0.5", - "vite": "6.0.0-beta.6" + "vite": "^6.0.1" }, "engines": { "node": "^18.17.1 || ^20.3.0 || >=21.0.0" diff --git a/packages/integrations/preact/package.json b/packages/integrations/preact/package.json index d039c95ff..1a39b5a00 100644 --- a/packages/integrations/preact/package.json +++ b/packages/integrations/preact/package.json @@ -41,7 +41,7 @@ "@preact/signals": "^1.3.0", "babel-plugin-transform-hook-names": "^1.0.2", "preact-render-to-string": "^6.5.11", - "vite": "^5.4.10" + "vite": "^6.0.1" }, "devDependencies": { "astro": "workspace:*", diff --git a/packages/integrations/react/package.json b/packages/integrations/react/package.json index eeb5ca4ab..5ffb1975a 100644 --- a/packages/integrations/react/package.json +++ b/packages/integrations/react/package.json @@ -49,9 +49,9 @@ "test": "astro-scripts test \"test/**/*.test.js\"" }, "dependencies": { - "@vitejs/plugin-react": "^4.3.3", + "@vitejs/plugin-react": "^4.3.4", "ultrahtml": "^1.5.3", - "vite": "6.0.0-beta.6" + "vite": "^6.0.1" }, "devDependencies": { "@types/react": "^18.3.12", diff --git a/packages/integrations/solid/package.json b/packages/integrations/solid/package.json index f46629d0f..0e3e9ffad 100644 --- a/packages/integrations/solid/package.json +++ b/packages/integrations/solid/package.json @@ -35,8 +35,8 @@ "dev": "astro-scripts dev \"src/**/*.ts\"" }, "dependencies": { - "vite-plugin-solid": "^2.10.2", - "vite": "6.0.0-beta.6" + "vite-plugin-solid": "^2.11.0", + "vite": "^6.0.1" }, "devDependencies": { "astro": "workspace:*", diff --git a/packages/integrations/solid/src/index.ts b/packages/integrations/solid/src/index.ts index 001f3d6ab..60680ff9c 100644 --- a/packages/integrations/solid/src/index.ts +++ b/packages/integrations/solid/src/index.ts @@ -45,43 +45,15 @@ async function getDevtoolsPlugin(logger: AstroIntegrationLogger, retrieve: boole } } -async function getViteConfiguration( - isDev: boolean, +function getViteConfiguration( { include, exclude }: Options, devtoolsPlugin: DevtoolsPlugin | null, ) { - // https://github.com/solidjs/vite-plugin-solid - // We inject the dev mode only if the user explicitly wants it or if we are in dev (serve) mode - const nestedDeps = ['solid-js', 'solid-js/web', 'solid-js/store', 'solid-js/html', 'solid-js/h']; const config: UserConfig = { - resolve: { - conditions: ['solid', ...(isDev ? ['development'] : [])], - dedupe: nestedDeps, - alias: [{ find: /^solid-refresh$/, replacement: '/@solid-refresh' }], - }, optimizeDeps: { - include: [...nestedDeps], exclude: ['@astrojs/solid-js/server.js'], }, - plugins: [ - solid({ include, exclude, dev: isDev, ssr: true }), - { - name: '@astrojs/solid:config-overrides', - enforce: 'post', - config() { - return { - esbuild: { - // To support using alongside other JSX frameworks, still let - // esbuild compile stuff. Solid goes first anyways. - include: /\.(m?ts|[jt]sx)$/, - }, - }; - }, - }, - ], - ssr: { - external: ['babel-preset-solid'], - }, + plugins: [solid({ include, exclude, ssr: true })], }; if (devtoolsPlugin) { @@ -128,7 +100,7 @@ export default function (options: Options = {}): AstroIntegration { addRenderer(getRenderer()); updateConfig({ - vite: await getViteConfiguration(command === 'dev', options, devtoolsPlugin), + vite: getViteConfiguration(options, devtoolsPlugin), }); if (devtoolsPlugin) { diff --git a/packages/integrations/svelte/package.json b/packages/integrations/svelte/package.json index 2d6aebe34..e8ef15a03 100644 --- a/packages/integrations/svelte/package.json +++ b/packages/integrations/svelte/package.json @@ -39,9 +39,9 @@ "dev": "astro-scripts dev \"src/**/*.ts\"" }, "dependencies": { - "@sveltejs/vite-plugin-svelte": "^4.0.0", + "@sveltejs/vite-plugin-svelte": "^5.0.1", "svelte2tsx": "^0.7.22", - "vite": "6.0.0-beta.6" + "vite": "^6.0.1" }, "devDependencies": { "astro": "workspace:*", diff --git a/packages/integrations/tailwind/package.json b/packages/integrations/tailwind/package.json index 073de3d41..c2d033b08 100644 --- a/packages/integrations/tailwind/package.json +++ b/packages/integrations/tailwind/package.json @@ -36,14 +36,14 @@ }, "dependencies": { "autoprefixer": "^10.4.20", - "postcss": "^8.4.47", + "postcss": "^8.4.49", "postcss-load-config": "^4.0.2" }, "devDependencies": { "astro": "workspace:*", "astro-scripts": "workspace:*", "tailwindcss": "^3.4.14", - "vite": "6.0.0-beta.6" + "vite": "^6.0.1" }, "peerDependencies": { "astro": "^3.0.0 || ^4.0.0 || ^5.0.0-beta.0", diff --git a/packages/integrations/vue/package.json b/packages/integrations/vue/package.json index 9b144f83c..e6a9db095 100644 --- a/packages/integrations/vue/package.json +++ b/packages/integrations/vue/package.json @@ -42,11 +42,11 @@ "test": "astro-scripts test \"test/**/*.test.js\"" }, "dependencies": { - "@vitejs/plugin-vue": "^5.1.4", + "@vitejs/plugin-vue": "^5.2.1", "@vitejs/plugin-vue-jsx": "^4.0.1", "@vue/compiler-sfc": "^3.5.12", - "vite-plugin-vue-devtools": "^7.6.3", - "vite": "6.0.0-beta.6" + "vite": "^6.0.1", + "vite-plugin-vue-devtools": "^7.6.3" }, "devDependencies": { "astro": "workspace:*", diff --git a/packages/studio/package.json b/packages/studio/package.json index 05be0d15e..36121bd4d 100644 --- a/packages/studio/package.json +++ b/packages/studio/package.json @@ -42,6 +42,6 @@ "astro": "workspace:*", "astro-scripts": "workspace:*", "typescript": "^5.6.3", - "vite": "6.0.0-beta.6" + "vite": "^6.0.1" } } |