@nuxt/docs-nightly 5.0.0-29558704.e2fc73c4 → 5.0.0-29558810.f465ca09
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -349,6 +349,38 @@ If you define redirect route rules, the property name has changed:
|
|
|
349
349
|
- **Runtime hooks**: `nitroApp.hooks.hook('beforeResponse', ...)` and `nitroApp.hooks.hook('afterResponse', ...)` have been replaced by `nitroApp.hooks.hook('response', ...)`.
|
|
350
350
|
- **`getRouteRules()` from `nitro/app`**: On the server, the Nitro helper changed from `getRouteRules(event)` to `getRouteRules(method, pathname)`, which returns `{ routeRules }`.
|
|
351
351
|
|
|
352
|
+
### Removal of `experimental.externalVue`
|
|
353
|
+
|
|
354
|
+
🚦 **Impact Level**: Minimal
|
|
355
|
+
|
|
356
|
+
#### What Changed
|
|
357
|
+
|
|
358
|
+
The `experimental.externalVue` option has been removed. Vue compiler dependencies (`@babel/parser`, `@vue/compiler-core`, `@vue/compiler-dom`, `@vue/compiler-ssr`, `estree-walker`) are now always replaced with mock proxies in the server bundle when `vue.runtimeCompiler` is not enabled.
|
|
359
|
+
|
|
360
|
+
#### Reasons for Change
|
|
361
|
+
|
|
362
|
+
With the migration to Nitro v3, all dependencies are bundled into the server output by default (unlike Nitro v2, which externalized `node_modules`). The `externalVue` option was originally designed to keep Vue as an external dependency, which was needed to avoid multiple copies of Vue from being bundled, but since Nitro v3 bundles everything regardless, the option became a no-op.
|
|
363
|
+
|
|
364
|
+
Vue's server builds include the full compiler toolchain, pulling `@babel/parser` (465KB) and other compiler packages into the server bundle unnecessarily. These compiler packages are only needed when `vue.runtimeCompiler` is enabled for runtime template compilation.
|
|
365
|
+
|
|
366
|
+
By always mocking these compiler dependencies, the default server bundle size is reduced by approximately 860KB (~59%).
|
|
367
|
+
|
|
368
|
+
#### Migration Steps
|
|
369
|
+
|
|
370
|
+
If you previously set `experimental.externalVue` explicitly, you should now remove it.
|
|
371
|
+
|
|
372
|
+
```diff
|
|
373
|
+
export default defineNuxtConfig({
|
|
374
|
+
experimental: {
|
|
375
|
+
- externalVue: false,
|
|
376
|
+
},
|
|
377
|
+
})
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
::note
|
|
381
|
+
If you use `vue.runtimeCompiler: true`, the real compiler packages are still included as before.
|
|
382
|
+
::
|
|
383
|
+
|
|
352
384
|
### Removal of Legacy `_renderResponse` Support
|
|
353
385
|
|
|
354
386
|
🚦 **Impact Level**: Minimal
|
|
@@ -69,24 +69,6 @@ export default defineNuxtConfig({
|
|
|
69
69
|
})
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
-
## externalVue
|
|
73
|
-
|
|
74
|
-
Externalizes `vue`, `@vue/*` and `vue-router` when building.
|
|
75
|
-
|
|
76
|
-
This flag is enabled by default, but you can disable this feature:
|
|
77
|
-
|
|
78
|
-
```ts twoslash [nuxt.config.ts]
|
|
79
|
-
export default defineNuxtConfig({
|
|
80
|
-
experimental: {
|
|
81
|
-
externalVue: false,
|
|
82
|
-
},
|
|
83
|
-
})
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
::warning
|
|
87
|
-
This feature will likely be removed in a near future.
|
|
88
|
-
::
|
|
89
|
-
|
|
90
72
|
## extractAsyncDataHandlers
|
|
91
73
|
|
|
92
74
|
Extracts handler functions from `useAsyncData` and `useLazyAsyncData` calls into separate chunks for improved code splitting and caching efficiency.
|