diff options
author | 2023-08-11 08:14:20 -0700 | |
---|---|---|
committer | 2023-08-11 11:14:20 -0400 | |
commit | 40efae65501fc79c281e34b5af912bf837b7105b (patch) | |
tree | 8a6b834647f9e6b2b36aceaaf47397cba8ac51e7 /packages/integrations/preact/src | |
parent | 866ed4098edffb052239cdb26e076cf8db61b1d9 (diff) | |
download | astro-40efae65501fc79c281e34b5af912bf837b7105b.tar.gz astro-40efae65501fc79c281e34b5af912bf837b7105b.tar.zst astro-40efae65501fc79c281e34b5af912bf837b7105b.zip |
[ci] release (beta) (#7952)astro@3.0.0-beta.1@astrojs/vercel@4.0.0-beta.1@astrojs/telemetry@3.0.0-beta.1@astrojs/solid-js@3.0.0-beta.1@astrojs/react@3.0.0-beta.1@astrojs/preact@3.0.0-beta.1@astrojs/netlify@3.0.0-beta.1@astrojs/cloudflare@7.0.0-beta.1
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'packages/integrations/preact/src')
-rw-r--r-- | packages/integrations/preact/src/index.ts | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/packages/integrations/preact/src/index.ts b/packages/integrations/preact/src/index.ts index 153b9e1c3..9551f97eb 100644 --- a/packages/integrations/preact/src/index.ts +++ b/packages/integrations/preact/src/index.ts @@ -1,5 +1,5 @@ import type { AstroIntegration, AstroRenderer, ViteUserConfig } from 'astro'; -import preact, {type PreactPluginOptions as VitePreactPluginOptions} from '@preact/preset-vite'; +import preact, { type PreactPluginOptions as VitePreactPluginOptions } from '@preact/preset-vite'; import { fileURLToPath } from 'node:url'; const babelCwd = new URL('../', import.meta.url); @@ -12,9 +12,9 @@ function getRenderer(development: boolean): AstroRenderer { }; } -export type Options =Pick<VitePreactPluginOptions, 'include' | 'exclude'> & { compat?: boolean }; +export type Options = Pick<VitePreactPluginOptions, 'include' | 'exclude'> & { compat?: boolean }; -export default function ({include, exclude, compat}: Options = {}): AstroIntegration { +export default function ({ include, exclude, compat }: Options = {}): AstroIntegration { return { name: '@astrojs/preact', hooks: { @@ -23,8 +23,8 @@ export default function ({include, exclude, compat}: Options = {}): AstroIntegra include, exclude, babel: { - cwd: fileURLToPath(babelCwd) - } + cwd: fileURLToPath(babelCwd), + }, }); const viteConfig: ViteUserConfig = { @@ -35,8 +35,8 @@ export default function ({include, exclude, compat}: Options = {}): AstroIntegra }; // If not compat, delete the plugin that does it - if(!compat) { - const pIndex = preactPlugin.findIndex(p => p.name == 'preact:config'); + if (!compat) { + const pIndex = preactPlugin.findIndex((p) => p.name == 'preact:config'); if (pIndex >= 0) { preactPlugin.splice(pIndex, 1); } @@ -44,12 +44,10 @@ export default function ({include, exclude, compat}: Options = {}): AstroIntegra viteConfig.optimizeDeps!.include!.push( 'preact/compat', 'preact/test-utils', - 'preact/compat/jsx-runtime', + 'preact/compat/jsx-runtime' ); viteConfig.resolve = { - alias: [ - { find: 'react/jsx-runtime', replacement: 'preact/jsx-runtime' }, - ], + alias: [{ find: 'react/jsx-runtime', replacement: 'preact/jsx-runtime' }], dedupe: ['preact/compat', 'preact'], }; // noExternal React entrypoints to be bundled, resolved, and aliased by Vite |