You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/docs/3.api/5.nuxt-config.md
+55Lines changed: 55 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,61 @@ Global registry scripts that should be loaded.
11
11
12
12
See the [Script Registry](/scripts) for more details.
13
13
14
+
## `partytown`:badge[Experimental]{color="amber"}
15
+
16
+
- Type: `(keyof ScriptRegistry)[]`
17
+
- Default: `[]`
18
+
19
+
Registry scripts to load via [Partytown](https://partytown.qwik.dev/) (web worker).
20
+
21
+
This is a shorthand for setting `partytown: true` on individual registry scripts. When a script is listed here, it will be loaded with `type="text/partytown"` so Partytown can execute it in a web worker.
Requires [`@nuxtjs/partytown`](https://github.com/nuxt-modules/partytown) to be installed. The `forward` array is **automatically configured** for supported registry scripts.
// Process partytown shorthand - add partytown: true to specified registry scripts
216
+
// and auto-configure @nuxtjs/partytown forward array
217
+
if(config.partytown?.length){
218
+
config.registry=config.registry||{}
219
+
constrequiredForwards: string[]=[]
220
+
221
+
for(constscriptKeyofconfig.partytown){
222
+
// Collect required forwards for this script
223
+
constforwards=PARTYTOWN_FORWARDS[scriptKey]
224
+
if(forwards){
225
+
requiredForwards.push(...forwards)
226
+
}
227
+
elseif(import.meta.dev){
228
+
logger.warn(`[partytown] "${scriptKey}" has no known Partytown forwards configured. It may not work correctly or may require manual forward configuration.`)
229
+
}
230
+
231
+
constexisting=config.registry[scriptKey]
232
+
if(Array.isArray(existing)){
233
+
// [input, options] format - merge partytown into options
0 commit comments