Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion packages/plugin-react/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ export interface Options {
babel?:
| BabelOptions
| ((id: string, options: { ssr?: boolean }) => BabelOptions)
/**
* Script to run as `async`
* We need this for streaming, otherwise script runs once streaming has finished
*/
async?: boolean
}

export type BabelOptions = Omit<
Expand Down Expand Up @@ -305,7 +310,7 @@ export default function viteReact(opts: Options = {}): PluginOption[] {
return [
{
tag: 'script',
attrs: { type: 'module' },
attrs: { type: 'module', async: !!opts.async },
children: preambleCode.replace(`__BASE__`, devBase),
},
]
Expand Down