Skip to content

Commit d9d6c63

Browse files
committed
fix: use async inline script
1 parent ec1dfb3 commit d9d6c63

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

packages/plugin-react-oxc/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ export default function viteReact(opts: Options = {}): PluginOption[] {
140140
return [
141141
{
142142
tag: 'script',
143-
attrs: { type: 'module' },
143+
attrs: { type: 'module', async: 'true' },
144144
children: getPreambleCode(config.server!.config.base),
145145
},
146146
]

packages/plugin-react-swc/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ const react = (_options?: Options): PluginOption[] => {
135135
transformIndexHtml: (_, config) => [
136136
{
137137
tag: 'script',
138-
attrs: { type: 'module' },
138+
attrs: { type: 'module', async: 'true' },
139139
children: getPreambleCode(config.server!.config.base),
140140
},
141141
],

packages/plugin-react/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ export default function viteReact(opts: Options = {}): PluginOption[] {
329329
return [
330330
{
331331
tag: 'script',
332-
attrs: { type: 'module' },
332+
attrs: { type: 'module', async: 'true' },
333333
children: getPreambleCode(config.server!.config.base),
334334
},
335335
]

0 commit comments

Comments
 (0)