summaryrefslogtreecommitdiff
path: root/packages/integrations/react/src
diff options
context:
space:
mode:
authorGravatar Houston (Bot) <108291165+astrobot-houston@users.noreply.github.com> 2023-08-18 08:46:47 -0700
committerGravatar GitHub <noreply@github.com> 2023-08-18 11:46:47 -0400
commite5c13881f188f7e67595e3b2c32940b603cc388c (patch)
tree416834f757016f6f4a4df5a2305febf3e20b5c11 /packages/integrations/react/src
parentf50d02c201032b41f75964717b359b90399e9a74 (diff)
downloadastro-e5c13881f188f7e67595e3b2c32940b603cc388c.tar.gz
astro-e5c13881f188f7e67595e3b2c32940b603cc388c.tar.zst
astro-e5c13881f188f7e67595e3b2c32940b603cc388c.zip
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'packages/integrations/react/src')
-rw-r--r--packages/integrations/react/src/index.ts17
1 files changed, 10 insertions, 7 deletions
diff --git a/packages/integrations/react/src/index.ts b/packages/integrations/react/src/index.ts
index 712b98610..1cc200bc3 100644
--- a/packages/integrations/react/src/index.ts
+++ b/packages/integrations/react/src/index.ts
@@ -44,7 +44,11 @@ function optionsPlugin(experimentalReactChildren: boolean): vite.Plugin {
};
}
-function getViteConfiguration({ include, exclude, experimentalReactChildren }: ReactIntegrationOptions = {}) {
+function getViteConfiguration({
+ include,
+ exclude,
+ experimentalReactChildren,
+}: ReactIntegrationOptions = {}) {
return {
optimizeDeps: {
include: [
@@ -62,10 +66,7 @@ function getViteConfiguration({ include, exclude, experimentalReactChildren }: R
: '@astrojs/react/server-v17.js',
],
},
- plugins: [
- react({ include, exclude }),
- optionsPlugin(!!experimentalReactChildren)
- ],
+ plugins: [react({ include, exclude }), optionsPlugin(!!experimentalReactChildren)],
resolve: {
dedupe: ['react', 'react-dom', 'react-dom/server'],
},
@@ -88,14 +89,16 @@ function getViteConfiguration({ include, exclude, experimentalReactChildren }: R
export default function ({
include,
exclude,
- experimentalReactChildren
+ experimentalReactChildren,
}: ReactIntegrationOptions = {}): AstroIntegration {
return {
name: '@astrojs/react',
hooks: {
'astro:config:setup': ({ config, command, addRenderer, updateConfig, injectScript }) => {
addRenderer(getRenderer());
- updateConfig({ vite: getViteConfiguration({ include, exclude, experimentalReactChildren }) });
+ updateConfig({
+ vite: getViteConfiguration({ include, exclude, experimentalReactChildren }),
+ });
if (command === 'dev') {
const preamble = FAST_REFRESH_PREAMBLE.replace(
`__BASE__`,