Skip to content

Commit

Permalink
fix script execution without default export
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-bromann committed Feb 26, 2024
1 parent 311c63a commit 1a97db7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ async function instrument(target: Target, onConnect: (value: ViteDevServer) => v
? await fs.readFile(target, 'utf-8')
: `<script type="module" src="/@fs${path.resolve(process.cwd(), target)}"></script>`
: `<script type="module">
import result from '${virtualModuleId}';
import * as target from '${virtualModuleId}';
import.meta.hot?.send('bx:event', {
name: 'doneEvent',
result
result: target.default
})
</script>`
const template = `
Expand Down

0 comments on commit 1a97db7

Please sign in to comment.