diff options
author | 2024-11-27 18:00:35 +0800 | |
---|---|---|
committer | 2024-11-27 18:00:35 +0800 | |
commit | 9f440196dc39f36fce0198bf4c97131160e5bcc1 (patch) | |
tree | abffe1350064663af8a46c86d819f6429087faac /packages/integrations/solid/src/index.ts | |
parent | a2f90ced77c18757883a4a060d2b321764a0c60f (diff) | |
download | astro-9f440196dc39f36fce0198bf4c97131160e5bcc1.tar.gz astro-9f440196dc39f36fce0198bf4c97131160e5bcc1.tar.zst astro-9f440196dc39f36fce0198bf4c97131160e5bcc1.zip |
Update Vite to 6.0.0 (#12524)
Diffstat (limited to 'packages/integrations/solid/src/index.ts')
-rw-r--r-- | packages/integrations/solid/src/index.ts | 34 |
1 files changed, 3 insertions, 31 deletions
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) { |