@@ -25,14 +25,22 @@ function babelTransform(filename: string, code: string) {
2525 visitor : {
2626 Import ( path : any ) {
2727 const importee : string = path . parent . arguments [ 0 ] . value ;
28-
2928 cache [ importee ] = path . parent . arguments [ 0 ] . value = transformImportee ( importee ) ;
3029 } ,
3130 ImportDeclaration ( path : any ) {
3231 const importee : string = path . node . source . value ;
33- // Replace relative imports, as import maps don't seem to be able to handle them properly
3432 cache [ importee ] = path . node . source . value = transformImportee ( importee ) ;
3533 } ,
34+ ExportAllDeclaration ( path : any ) {
35+ const importee : string = path . node . source . value ;
36+ cache [ importee ] = path . node . source . value = transformImportee ( importee ) ;
37+ } ,
38+ ExportNamedDeclaration ( path : any ) {
39+ const importee : string = path . node . source ?. value ;
40+ if ( importee ) {
41+ cache [ importee ] = path . node . source . value = transformImportee ( importee ) ;
42+ }
43+ } ,
3644 } ,
3745 } ;
3846 } ,
@@ -121,7 +129,7 @@ function bundle(entryPoint: string, fileRecord: Record<string, string>) {
121129 return dataToReturn ;
122130}
123131
124- async function compile ( tabs : Tab [ ] , event : string ) {
132+ function compile ( tabs : Tab [ ] , event : string ) {
125133 const tabsRecord : Record < string , string > = { } ;
126134 for ( const tab of tabs ) {
127135 tabsRecord [ `./${ tab . name . replace ( / .( t s x | j s x ) $ / , '' ) } ` ] = tab . source ;
@@ -130,8 +138,8 @@ async function compile(tabs: Tab[], event: string) {
130138 return { event, compiled : bundled } ;
131139}
132140
133- async function babel ( tab : Tab , compileOpts : any ) {
134- const { code } = await transform ( tab . source , {
141+ function babel ( tab : Tab , compileOpts : any ) {
142+ const { code } = transform ( tab . source , {
135143 presets : [
136144 [ babelPresetSolid , compileOpts ] ,
137145 [ 'typescript' , { onlyRemoveTypeImports : true } ] ,
@@ -141,14 +149,14 @@ async function babel(tab: Tab, compileOpts: any) {
141149 return { event : 'BABEL' , compiled : code } ;
142150}
143151
144- self . addEventListener ( 'message' , async ( { data } ) => {
152+ self . addEventListener ( 'message' , ( { data } ) => {
145153 const { event, tabs, tab, compileOpts } = data ;
146154
147155 try {
148156 if ( event === 'BABEL' ) {
149- self . postMessage ( await babel ( tab , compileOpts ) ) ;
157+ self . postMessage ( babel ( tab , compileOpts ) ) ;
150158 } else if ( event === 'ROLLUP' ) {
151- self . postMessage ( await compile ( tabs , event ) ) ;
159+ self . postMessage ( compile ( tabs , event ) ) ;
152160 }
153161 } catch ( e ) {
154162 self . postMessage ( { event : 'ERROR' , error : e } ) ;
0 commit comments