Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit 9443b9d

Browse files
committed
refactor(fw/react): improve init function
1 parent d2b8261 commit 9443b9d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

framework/react/init.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export async function init(app: ServerApplication) {
77
if (app.mode === 'development') {
88
const alephPkgUri = getAlephPkgUri()
99
app.injectCode('hmr', (url: string, code: string) => {
10-
const reactRefresh = code.includes('$RefreshSig$') || code.includes('$RefreshReg$')
10+
const reactRefresh = code.includes('$RefreshSig$(') || code.includes('$RefreshReg$(')
1111
if (reactRefresh) {
1212
const refreshModuleUrl = getRelativePath(
1313
path.dirname(toLocalUrl(url)),
@@ -32,7 +32,7 @@ export async function init(app: ServerApplication) {
3232
app.injectCode('compilation', (url: string, code: string) => {
3333
if (url === '/main.js') {
3434
return [
35-
`import '.${toLocalUrl(`${alephPkgUri}/framework/react/refresh.js`)}';`,
35+
`import ".${toLocalUrl(`${alephPkgUri}/framework/react/refresh.js`)}";`,
3636
code
3737
].join('\n')
3838
}

0 commit comments

Comments
 (0)