This repository was archived by the owner on Jul 6, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ import type { Aleph } from '../../types.ts'
4
4
export async function init ( aleph : Aleph ) {
5
5
if ( aleph . mode === 'development' ) {
6
6
const alephPkgUri = getAlephPkgUri ( )
7
- const alephPkgPath = alephPkgUri . replace ( 'https://' , '' ) . replace ( 'http://localhost:' , 'http_localhost_' )
8
7
const refreshModule = await aleph . addModule ( `${ alephPkgUri } /framework/react/refresh.ts` , `
9
8
import runtime from 'https://esm.sh/[email protected] /runtime'
10
9
import util from '../../shared/util.ts'
@@ -19,7 +18,7 @@ export async function init(aleph: Aleph) {
19
18
__REACT_REFRESH__: util.debounce(runtime.performReactRefresh, 30)
20
19
})
21
20
` )
22
- aleph . onTransform ( 'mainscript ' , ( { code } ) => ( {
21
+ aleph . onTransform ( 'main ' , ( { code } ) => ( {
23
22
code : [
24
23
`import ".${ refreshModule . jsFile } ";` ,
25
24
code
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ type LoadListener = {
76
76
}
77
77
78
78
type TransformListener = {
79
- test : RegExp | 'hmr' | 'mainscript ' ,
79
+ test : RegExp | 'hmr' | 'main ' ,
80
80
transform ( input : TransformInput ) : TransformOutput ,
81
81
}
82
82
@@ -515,7 +515,7 @@ export class Aleph implements IAleph {
515
515
this . #loadListeners. push ( { test, load : callback } )
516
516
}
517
517
518
- onTransform ( test : RegExp | 'hmr' | 'mainscript ' , callback : ( input : TransformInput ) => TransformOutput ) : void {
518
+ onTransform ( test : RegExp | 'hmr' | 'main ' , callback : ( input : TransformInput ) => TransformOutput ) : void {
519
519
this . #transformListeners. push ( { test, transform : callback } )
520
520
}
521
521
@@ -691,7 +691,7 @@ export class Aleph implements IAleph {
691
691
`bootstrap(${ JSON . stringify ( config , undefined , this . isDev ? 2 : undefined ) } );`
692
692
] . filter ( Boolean ) . join ( '\n' )
693
693
this . #transformListeners. forEach ( ( { test, transform } ) => {
694
- if ( test === 'mainscript ' ) {
694
+ if ( test === 'main ' ) {
695
695
const ret = transform ( { specifier : '/main.js' , code } )
696
696
code = ret . code
697
697
}
You can’t perform that action at this time.
0 commit comments