This repository has been archived by the owner on Apr 6, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
experimental.ts
93 lines (82 loc) · 2.78 KB
/
experimental.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import { defineUntypedSchema } from 'untyped'
export default defineUntypedSchema({
/** @version 3 */
experimental: {
/**
* Set to true to generate an async entry point for the Vue bundle (for module federation support).
*/
asyncEntry: {
$resolve: (val) => val ?? false
},
/**
* Enable Vue's reactivity transform
* @see https://vuejs.org/guide/extras/reactivity-transform.html
*/
reactivityTransform: false,
/**
* Externalize `vue`, `@vue/*` and `vue-router` when building.
* @see https://github.com/nuxt/framework/issues/4084
*/
externalVue: true,
/**
* Tree shakes contents of client-only components from server bundle.
* @see https://github.com/nuxt/framework/pull/5750
*/
treeshakeClientOnly: true,
/**
* Use vite-node for on-demand server chunk loading
*
* @deprecated use `vite.devBundler: 'vite-node'`
*/
viteNode: {
$resolve: (val) => {
val = process.env.EXPERIMENTAL_VITE_NODE ? true : val
if (val === true) {
console.warn('`vite-node` is now enabled by default. You can safely remove `experimental.viteNode` from your config.')
} else if (val === false) {
console.warn('`vite-node` is now enabled by default. To disable it, set `vite.devBundler` to `legacy` instead.')
}
return val ?? true
}
},
/**
* Split server bundle into multiple chunks and dynamically import them.
*
* @see https://github.com/nuxt/framework/issues/6432
*/
viteServerDynamicImports: true,
/**
* Inline styles when rendering HTML (currently vite only).
*
* You can also pass a function that receives the path of a Vue component
* and returns a boolean indicating whether to inline the styles for that component.
*
* @type {boolean | ((id?: string) => boolean)}
*/
inlineSSRStyles: {
async $resolve (val, get) {
if (val === false || (await get('dev')) || (await get('ssr')) === false || (await get('builder')) === '@nuxt/webpack-builder') {
return false
}
// Enabled by default for vite prod with ssr
return val ?? true
}
},
/**
* Turn off rendering of Nuxt scripts and JS resource hints.
*/
noScripts: false,
/**
* When this option is enabled (by default) payload of pages generated with `nuxt generate` are extracted
*/
payloadExtraction: true,
/** Enable cross-origin prefetch using the Speculation Rules API. */
crossOriginPrefetch: false,
/**
* Write early hints when using node server.
*
* @note If you are using Nginx, set the value to `false`. Nginx does not support 103 Early hints in the current version.
*/
writeEarlyHints: true
}
})