summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.changeset/cold-knives-peel.md5
-rw-r--r--packages/integrations/react/package.json1
-rw-r--r--packages/integrations/react/src/index.ts5
-rw-r--r--pnpm-lock.yaml3
4 files changed, 7 insertions, 7 deletions
diff --git a/.changeset/cold-knives-peel.md b/.changeset/cold-knives-peel.md
new file mode 100644
index 000000000..56ef2aff0
--- /dev/null
+++ b/.changeset/cold-knives-peel.md
@@ -0,0 +1,5 @@
+---
+'@astrojs/react': patch
+---
+
+Fix React dev mode using a base
diff --git a/packages/integrations/react/package.json b/packages/integrations/react/package.json
index 2b9558e31..94814bdd2 100644
--- a/packages/integrations/react/package.json
+++ b/packages/integrations/react/package.json
@@ -45,7 +45,6 @@
"dev": "astro-scripts dev \"src/**/*.ts\""
},
"dependencies": {
- "@astrojs/internal-helpers": "0.2.0",
"@vitejs/plugin-react": "^4.0.4",
"ultrahtml": "^1.3.0"
},
diff --git a/packages/integrations/react/src/index.ts b/packages/integrations/react/src/index.ts
index a09544baf..2a78ce9cd 100644
--- a/packages/integrations/react/src/index.ts
+++ b/packages/integrations/react/src/index.ts
@@ -1,4 +1,3 @@
-import { appendForwardSlash } from '@astrojs/internal-helpers/path';
import react, { type Options as ViteReactPluginOptions } from '@vitejs/plugin-react';
import type { AstroIntegration } from 'astro';
import { version as ReactVersion } from 'react-dom';
@@ -94,7 +93,7 @@ export default function ({
return {
name: '@astrojs/react',
hooks: {
- 'astro:config:setup': ({ config, command, addRenderer, updateConfig, injectScript }) => {
+ 'astro:config:setup': ({ command, addRenderer, updateConfig, injectScript }) => {
addRenderer(getRenderer());
updateConfig({
vite: getViteConfiguration({ include, exclude, experimentalReactChildren }),
@@ -102,7 +101,7 @@ export default function ({
if (command === 'dev') {
const preamble = FAST_REFRESH_PREAMBLE.replace(
`__BASE__`,
- appendForwardSlash(config.base)
+ '/'
);
injectScript('before-hydration', preamble);
}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index feec7faa1..1ab1a07e0 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -4515,9 +4515,6 @@ importers:
packages/integrations/react:
dependencies:
- '@astrojs/internal-helpers':
- specifier: 0.2.0
- version: link:../../internal-helpers
'@vitejs/plugin-react':
specifier: ^4.0.4
version: 4.0.4(vite@4.4.9)