summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar delucis <delucis@users.noreply.github.com> 2022-06-29 15:48:55 +0000
committerGravatar fredkbot <fred+astrobot@astro.build> 2022-06-29 15:48:55 +0000
commite667477103cdd8f420d7dc86d55d5bebe86ef4e2 (patch)
tree495532f036d9fbe2238d08ab98344be5c2824e0b
parente3fdc9b4030b96e815c133a388a7625b7e8e4a2e (diff)
downloadastro-e667477103cdd8f420d7dc86d55d5bebe86ef4e2.tar.gz
astro-e667477103cdd8f420d7dc86d55d5bebe86ef4e2.tar.zst
astro-e667477103cdd8f420d7dc86d55d5bebe86ef4e2.zip
[ci] format
-rw-r--r--packages/integrations/preact/src/index.ts47
1 files changed, 25 insertions, 22 deletions
diff --git a/packages/integrations/preact/src/index.ts b/packages/integrations/preact/src/index.ts
index 7c7ad618d..67a972475 100644
--- a/packages/integrations/preact/src/index.ts
+++ b/packages/integrations/preact/src/index.ts
@@ -32,14 +32,17 @@ function getCompatRenderer(): AstroRenderer {
return {
plugins: [
jsx({}, { runtime: 'automatic', importSource: 'preact/compat' }),
- ['babel-plugin-module-resolver', {
- alias: {
- 'react': 'preact/compat',
- 'react-dom/test-utils': 'preact/test-utils',
- 'react-dom': 'preact/compat',
- 'react/jsx-runtime': 'preact/jsx-runtime'
- }
- }],
+ [
+ 'babel-plugin-module-resolver',
+ {
+ alias: {
+ react: 'preact/compat',
+ 'react-dom/test-utils': 'preact/test-utils',
+ 'react-dom': 'preact/compat',
+ 'react/jsx-runtime': 'preact/jsx-runtime',
+ },
+ },
+ ],
],
};
},
@@ -61,25 +64,25 @@ function getViteConfiguration(compat?: boolean): ViteUserConfig {
external: ['preact-render-to-string'],
},
};
-
+
if (compat) {
- viteConfig.optimizeDeps!.include!.push(
+ viteConfig.optimizeDeps!.include!.push(
'preact/compat',
'preact/test-utils',
- 'preact/compat/jsx-runtime',
+ 'preact/compat/jsx-runtime'
);
- viteConfig.resolve = {
- alias: [
+ viteConfig.resolve = {
+ alias: [
{ find: 'react', replacement: 'preact/compat' },
- { find: 'react-dom/test-utils', replacement: 'preact/test-utils' },
- { find: 'react-dom', replacement: 'preact/compat' },
- { find: 'react/jsx-runtime', replacement: 'preact/jsx-runtime' }
- ],
- dedupe: ['preact/compat'],
- };
- }
-
- return viteConfig
+ { find: 'react-dom/test-utils', replacement: 'preact/test-utils' },
+ { find: 'react-dom', replacement: 'preact/compat' },
+ { find: 'react/jsx-runtime', replacement: 'preact/jsx-runtime' },
+ ],
+ dedupe: ['preact/compat'],
+ };
+ }
+
+ return viteConfig;
}
export default function ({ compat }: { compat?: boolean } = {}): AstroIntegration {