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
**Note:** It is highly recommended that your edge CDN (nginx, apache, cloud) serves the `public/` directory instead.
86
+
**Note:** It is highly recommended that your edge CDN (nginx, apache, cloud) serves the `.output/public/` directory instead to enable compression and higher lever caching.
76
87
77
88
### `noPublicDir`
78
89
79
-
- Default: `false`
90
+
- Default: `false`{lang=ts}
80
91
81
-
If enabled, disabled `.output/public` directory creation. Skipping to copy `public/` dir and also disables prerenderer.
92
+
If enabled, disabled `.output/public` directory creation. Skipping to copy `public/` dir and also disables pre-renderering.
82
93
83
94
### `publicAssets`
84
95
@@ -88,67 +99,70 @@ If a `public/` directory is detected, it will be added by default, but you can a
If enabled, Nitro will generate a pre-compressed (gzip and/or brotli) version of supported types of public assets and prerendered routes
94
105
larger than 1024 bytes into the public directory. The best compression level is used. Using this option you can support zero overhead asset compression without using a CDN.
95
106
96
-
The compressible MIME types are:
97
-
98
-
- application/dash+xml
99
-
- application/eot
100
-
- application/font
101
-
- application/font-sfnt
102
-
- application/javascript
103
-
- application/json
104
-
- application/opentype
105
-
- application/otf
106
-
- application/pkcs7-mime
107
-
- application/protobuf
108
-
- application/rss+xml
109
-
- application/truetype
110
-
- application/ttf
111
-
- application/vnd.apple.mpegurl
112
-
- application/vnd.mapbox-vector-tile
113
-
- application/vnd.ms-fontobject
114
-
- application/xhtml+xml
115
-
- application/xml
116
-
- application/x-font-opentype
117
-
- application/x-font-truetype
118
-
- application/x-font-ttf
119
-
- application/x-httpd-cgi
120
-
- application/x-javascript
121
-
- application/x-mpegurl
122
-
- application/x-opentype
123
-
- application/x-otf
124
-
- application/x-perl
125
-
- application/x-ttf
126
-
- font/eot
127
-
- font/opentype
128
-
- font/otf
129
-
- font/ttf
130
-
- image/svg+xml
131
-
- text/css
132
-
- text/csv
133
-
- text/html
134
-
- text/javascript
135
-
- text/js
136
-
- text/plain
137
-
- text/richtext
138
-
- text/tab-separated-values
139
-
- text/xml
140
-
- text/x-component
141
-
- text/x-java-source
142
-
- text/x-script
143
-
- vnd.apple.mpegurl
107
+
::callout
108
+
#summary
109
+
List of compressible MIME types:
110
+
#content
111
+
-`application/dash+xml`
112
+
-`application/eot`
113
+
-`application/font`
114
+
-`application/font-sfnt`
115
+
-`application/javascript`
116
+
-`application/json`
117
+
-`application/opentype`
118
+
-`application/otf`
119
+
-`application/pkcs7-mime`
120
+
-`application/protobuf`
121
+
-`application/rss+xml`
122
+
-`application/truetype`
123
+
-`application/ttf`
124
+
-`application/vnd.apple.mpegurl`
125
+
-`application/vnd.mapbox-vector-tile`
126
+
-`application/vnd.ms-fontobject`
127
+
-`application/xhtml+xml`
128
+
-`application/xml`
129
+
-`application/x-font-opentype`
130
+
-`application/x-font-truetype`
131
+
-`application/x-font-ttf`
132
+
-`application/x-httpd-cgi`
133
+
-`application/x-javascript`
134
+
-`application/x-mpegurl`
135
+
-`application/x-opentype`
136
+
-`application/x-otf`
137
+
-`application/x-perl`
138
+
-`application/x-ttf`
139
+
-`font/eot`
140
+
-`font/opentype`
141
+
-`font/otf`
142
+
-`font/ttf`
143
+
-`image/svg+xml`
144
+
-`text/css`
145
+
-`text/csv`
146
+
-`text/html`
147
+
-`text/javascript`
148
+
-`text/js`
149
+
-`text/plain`
150
+
-`text/richtext`
151
+
-`text/tab-separated-values`
152
+
-`text/xml`
153
+
-`text/x-component`
154
+
-`text/x-java-source`
155
+
-`text/x-script`
156
+
-`vnd.apple.mpegurl`
157
+
::
144
158
145
159
### `serverAssets`
146
160
147
-
Assets can be accessed in server logic and bundled in production.
161
+
Assets can be accessed in server logic and bundled in production.[Read more](/guide/introduction/assets#server-assets).
148
162
149
163
### `devServer`
150
164
151
-
- Default: `{ watch: [] }`
165
+
- Default: `{ watch: [] }`{lang=ts}
152
166
153
167
Dev server options. You can use `watch` to make the dev server reload if any file changes in specified paths.
154
168
@@ -172,11 +186,11 @@ An array of paths to nitro plugins. They will be executed by order on the first
172
186
173
187
A map from dynamic virtual import names to their contents or an (async) function that returns it.
174
188
175
-
<!-- Routing-->
189
+
##Routing
176
190
177
191
### `baseURL`
178
192
179
-
Default: `/` (or `NITRO_APP_BASE_URL` environment variable if provided)
193
+
Default: `/`{lang=ts} (or `NITRO_APP_BASE_URL` environment variable if provided)
Route options. It is a map from route pattern (following [unjs/radix3](https://github.com/unjs/radix3#route-matcher)) to route options.
241
255
242
-
When `cache` option is set, handlers matching pattern will be automatically wrapped with `defineCachedEventHandler`. See [Cache API](/guide/introduction/cache) for all available cache options. (`swr: true|number` is shortcut for `cache: { swr: true, maxAge: number }`.)
256
+
When `cache` option is set, handlers matching pattern will be automatically wrapped with `defineCachedEventHandler`.
257
+
258
+
See the [Cache API](/guide/introduction/cache) for all available cache options.
259
+
260
+
::alert
261
+
`swr: true|number` is shortcut for `cache: { swr: true, maxAge: number }`
@@ -269,7 +287,7 @@ Any route that starts with a prefix listed in `ignore` will be ignored.
269
287
270
288
If `crawlLinks` option is set to `true`, nitro starts with `/` by default (or all routes in `routes` array) and for HTML pages extracts `<a href="">` tags and prerender them as well.
271
289
272
-
<!-- Directories-->
290
+
##Directories
273
291
274
292
### `rootDir`
275
293
@@ -297,7 +315,7 @@ nitro's temporary working directory for generating build-related files.
0 commit comments