Skip to content

Commit 88585db

Browse files
authored
fix: add explicit semicolon in preambleCode (#485)
1 parent 2cf67b0 commit 88585db

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

packages/common/refresh-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const refreshContentRE = /\$RefreshReg\$\(/
66
// NOTE: this is exposed publicly via plugin-react
77
export const preambleCode = `import { injectIntoGlobalHook } from "__BASE__${runtimePublicPath.slice(
88
1,
9-
)}"
9+
)}";
1010
injectIntoGlobalHook(window);
1111
window.$RefreshReg$ = () => {};
1212
window.$RefreshSig$ = () => (type) => type;`

packages/plugin-react-oxc/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Unreleased
44

5+
### Add explicit semicolon in preambleCode [#485](https://github.com/vitejs/vite-plugin-react/pull/485)
6+
7+
This fixes an edge case when using HTML minifiers that strips line breaks aggressively.
8+
59
## 0.2.0 (2025-05-23)
610

711
### Add `filter` for rolldown-vite [#470](https://github.com/vitejs/vite-plugin-react/pull/470)

packages/plugin-react-swc/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Unreleased
44

5+
### Add explicit semicolon in preambleCode [#485](https://github.com/vitejs/vite-plugin-react/pull/485)
6+
7+
This fixes an edge case when using HTML minifiers that strips line breaks aggressively.
8+
59
## 3.10.0 (2025-05-23)
610

711
### Add `filter` for rolldown-vite [#470](https://github.com/vitejs/vite-plugin-react/pull/470)

packages/plugin-react/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Unreleased
44

5+
### Add explicit semicolon in preambleCode [#485](https://github.com/vitejs/vite-plugin-react/pull/485)
6+
7+
This fixes an edge case when using HTML minifiers that strips line breaks aggressively.
8+
59
## 4.5.0 (2025-05-23)
610

711
### Add `filter` for rolldown-vite [#470](https://github.com/vitejs/vite-plugin-react/pull/470)

0 commit comments

Comments
 (0)