@hono/vite-build 1.9.2 → 1.10.0
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.
- package/CHANGELOG.md +18 -0
- package/dist/adapter/bun/index.d.ts +2 -1
- package/dist/adapter/bun/index.js +30 -3
- package/dist/adapter/vercel/index.d.ts +2 -2
- package/dist/adapter/vercel/index.js +3 -4
- package/dist/adapter/vercel/types.d.ts +161 -64
- package/dist/base.js +3 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @hono/vite-build
|
|
2
2
|
|
|
3
|
+
## 1.10.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#339](https://github.com/honojs/vite-plugins/pull/339) [`6896d6d17809c8148c1b2ad067a7deeb4ecb6744`](https://github.com/honojs/vite-plugins/commit/6896d6d17809c8148c1b2ad067a7deeb4ecb6744) Thanks [@josiahwiebe](https://github.com/josiahwiebe)! - feat: allows configuring vercel helpers
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- [#342](https://github.com/honojs/vite-plugins/pull/342) [`ce81be036106779d04fe690d7eb8baa85b47b03f`](https://github.com/honojs/vite-plugins/commit/ce81be036106779d04fe690d7eb8baa85b47b03f) Thanks [@meck93](https://github.com/meck93)! - Fix static path discovery when `publicDir` does not exist.
|
|
12
|
+
Split shared `try/catch` so a missing `publicDir` no longer prevents `outDir` from being read, which caused `serveStatic` middleware to not be injected.
|
|
13
|
+
|
|
14
|
+
## 1.9.3
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- [#337](https://github.com/honojs/vite-plugins/pull/337) [`a759e7533a915215154d4a211893d309e80199b4`](https://github.com/honojs/vite-plugins/commit/a759e7533a915215154d4a211893d309e80199b4) Thanks [@meck93](https://github.com/meck93)! - Fix Bun adapter build output to preserve an entry's `websocket` handler in the generated default export.
|
|
19
|
+
This prevents Bun runtime WebSocket upgrade failures when apps export `{ fetch, websocket }`.
|
|
20
|
+
|
|
3
21
|
## 1.9.2
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -5,6 +5,7 @@ import '../../entry/index.js';
|
|
|
5
5
|
type BunBuildOptions = {
|
|
6
6
|
staticRoot?: string | undefined;
|
|
7
7
|
} & BuildOptions;
|
|
8
|
+
declare const defaultOptions: BunBuildOptions;
|
|
8
9
|
declare const bunBuildPlugin: (pluginOptions?: BunBuildOptions) => Plugin;
|
|
9
10
|
|
|
10
|
-
export { BunBuildOptions, bunBuildPlugin as default };
|
|
11
|
+
export { BunBuildOptions, bunBuildPlugin as default, defaultOptions };
|
|
@@ -1,5 +1,29 @@
|
|
|
1
|
-
import buildPlugin from "../../base.js";
|
|
1
|
+
import buildPlugin, { defaultOptions as baseDefaultOptions } from "../../base.js";
|
|
2
2
|
import { serveStaticHook } from "../../entry/serve-static.js";
|
|
3
|
+
const defaultOptions = {
|
|
4
|
+
...baseDefaultOptions,
|
|
5
|
+
entryContentAfterHooks: [
|
|
6
|
+
() => `
|
|
7
|
+
let websocket
|
|
8
|
+
for (const [, app] of Object.entries(modules)) {
|
|
9
|
+
if (
|
|
10
|
+
app &&
|
|
11
|
+
typeof app === 'object' &&
|
|
12
|
+
'websocket' in app &&
|
|
13
|
+
app.websocket !== undefined
|
|
14
|
+
) {
|
|
15
|
+
if (websocket !== undefined) {
|
|
16
|
+
throw new Error(
|
|
17
|
+
\`Handler "websocket" is defined in multiple entry files. Please ensure each handler is defined only once.\`
|
|
18
|
+
)
|
|
19
|
+
}
|
|
20
|
+
websocket = app.websocket
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
`
|
|
24
|
+
],
|
|
25
|
+
entryContentDefaultExportHook: (appName) => `export default websocket !== undefined ? { fetch: ${appName}.fetch.bind(${appName}), websocket } : ${appName}`
|
|
26
|
+
};
|
|
3
27
|
const bunBuildPlugin = (pluginOptions) => {
|
|
4
28
|
return {
|
|
5
29
|
...buildPlugin({
|
|
@@ -16,12 +40,15 @@ const bunBuildPlugin = (pluginOptions) => {
|
|
|
16
40
|
}
|
|
17
41
|
]
|
|
18
42
|
},
|
|
19
|
-
...pluginOptions
|
|
43
|
+
...pluginOptions,
|
|
44
|
+
entryContentAfterHooks: pluginOptions?.entryContentAfterHooks ?? defaultOptions.entryContentAfterHooks,
|
|
45
|
+
entryContentDefaultExportHook: pluginOptions?.entryContentDefaultExportHook ?? defaultOptions.entryContentDefaultExportHook
|
|
20
46
|
}),
|
|
21
47
|
name: "@hono/vite-build/bun"
|
|
22
48
|
};
|
|
23
49
|
};
|
|
24
50
|
var bun_default = bunBuildPlugin;
|
|
25
51
|
export {
|
|
26
|
-
bun_default as default
|
|
52
|
+
bun_default as default,
|
|
53
|
+
defaultOptions
|
|
27
54
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Plugin } from 'vite';
|
|
2
2
|
import { BuildOptions } from '../../base.js';
|
|
3
|
-
import { VercelBuildConfigV3,
|
|
3
|
+
import { VercelBuildConfigV3, VercelNodejsServerlessFunctionConfig } from './types.js';
|
|
4
4
|
import '../../entry/index.js';
|
|
5
5
|
|
|
6
6
|
type VercelBuildOptions = {
|
|
7
7
|
vercel?: {
|
|
8
8
|
config?: VercelBuildConfigV3;
|
|
9
|
-
function?:
|
|
9
|
+
function?: Partial<VercelNodejsServerlessFunctionConfig>;
|
|
10
10
|
};
|
|
11
11
|
} & Omit<BuildOptions, 'output' | 'outputDir'>;
|
|
12
12
|
declare const vercelBuildPlugin: (pluginOptions?: VercelBuildOptions) => Plugin;
|
|
@@ -60,15 +60,14 @@ const vercelBuildPlugin = (pluginOptions) => {
|
|
|
60
60
|
runtime: getRuntimeVersion(),
|
|
61
61
|
launcherType: "Nodejs",
|
|
62
62
|
handler: BUNDLE_NAME,
|
|
63
|
-
shouldAddHelpers:
|
|
63
|
+
shouldAddHelpers: Boolean(pluginOptions?.vercel?.function?.shouldAddHelpers),
|
|
64
64
|
shouldAddSourcemapSupport: Boolean(config.build.sourcemap),
|
|
65
65
|
supportsResponseStreaming: true
|
|
66
66
|
};
|
|
67
|
+
const publicDirPath = resolve(config.root, config.publicDir);
|
|
67
68
|
await Promise.all([
|
|
68
69
|
// Copy static files to the .vercel/output/static directory
|
|
69
|
-
cp(
|
|
70
|
-
recursive: true
|
|
71
|
-
}),
|
|
70
|
+
...existsSync(publicDirPath) ? [cp(publicDirPath, resolve(outputDir, "static"), { recursive: true })] : [],
|
|
72
71
|
// Write the all necessary config files
|
|
73
72
|
writeJSON(resolve(outputDir, "config.json"), buildConfig),
|
|
74
73
|
writeJSON(resolve(functionDir, ".vc-config.json"), functionConfig),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Main configuration type for Vercel Build Output API v3.
|
|
3
3
|
* This type represents the root configuration object that should be output in the `.vercel/output/config.json` file.
|
|
4
|
-
* @see https://vercel.com/docs/build-output-api/configuration
|
|
4
|
+
* @see https://vercel.com/docs/build-output-api/v3/configuration
|
|
5
5
|
*/
|
|
6
6
|
type VercelBuildConfigV3 = {
|
|
7
7
|
/** Version identifier for the Build Output API. Must be 3. */
|
|
@@ -14,33 +14,38 @@ type VercelBuildConfigV3 = {
|
|
|
14
14
|
/**
|
|
15
15
|
* Configuration for Vercel's Image Optimization feature.
|
|
16
16
|
* Defines how images should be optimized, cached, and served.
|
|
17
|
-
* @see https://vercel.com/docs/build-output-api/configuration#images
|
|
17
|
+
* @see https://vercel.com/docs/build-output-api/v3/configuration#images
|
|
18
18
|
*/
|
|
19
19
|
images?: ImagesConfig;
|
|
20
20
|
/**
|
|
21
21
|
* Custom domain wildcard configurations for internationalization.
|
|
22
22
|
* Maps domain names to values that can be referenced by the routes configuration.
|
|
23
|
-
* @see https://vercel.com/docs/build-output-api/configuration#wildcard
|
|
23
|
+
* @see https://vercel.com/docs/build-output-api/v3/configuration#wildcard
|
|
24
24
|
*/
|
|
25
25
|
wildcard?: WildCard[];
|
|
26
26
|
/**
|
|
27
27
|
* File-specific overrides for static files in the `.vercel/output/static` directory.
|
|
28
28
|
* Allows overriding Content-Type headers and URL paths for static files.
|
|
29
|
-
* @see https://vercel.com/docs/build-output-api/configuration#overrides
|
|
29
|
+
* @see https://vercel.com/docs/build-output-api/v3/configuration#overrides
|
|
30
30
|
*/
|
|
31
31
|
overrides?: Record<string, Override>;
|
|
32
32
|
/**
|
|
33
33
|
* Array of file paths or glob patterns to be cached between builds.
|
|
34
34
|
* Only relevant when Vercel is building from source code.
|
|
35
|
-
* @see https://vercel.com/docs/build-output-api/configuration#cache
|
|
35
|
+
* @see https://vercel.com/docs/build-output-api/v3/configuration#cache
|
|
36
36
|
*/
|
|
37
37
|
cache?: string[];
|
|
38
38
|
/**
|
|
39
39
|
* Scheduled tasks configuration for production deployments.
|
|
40
40
|
* Defines API routes that should be invoked on a schedule.
|
|
41
|
-
* @see https://vercel.com/docs/build-output-api/configuration#crons
|
|
41
|
+
* @see https://vercel.com/docs/build-output-api/v3/configuration#crons
|
|
42
42
|
*/
|
|
43
43
|
crons?: Cron[];
|
|
44
|
+
/**
|
|
45
|
+
* Framework metadata for display purposes only.
|
|
46
|
+
* @see https://vercel.com/docs/build-output-api/v3/configuration#framework
|
|
47
|
+
*/
|
|
48
|
+
framework?: Framework;
|
|
44
49
|
};
|
|
45
50
|
/**
|
|
46
51
|
* Route configuration that can either be a Source route or a Handler route.
|
|
@@ -69,15 +74,19 @@ type Source = {
|
|
|
69
74
|
/** HTTP status code to return (e.g., 308 for redirects) */
|
|
70
75
|
status?: number;
|
|
71
76
|
/** Conditions that must be present in the request for the route to match */
|
|
72
|
-
has?:
|
|
77
|
+
has?: HasField;
|
|
73
78
|
/** Conditions that must be absent from the request for the route to match */
|
|
74
|
-
missing?:
|
|
79
|
+
missing?: HasField;
|
|
75
80
|
/** Configuration for locale-based routing and redirects */
|
|
76
81
|
locale?: Locale;
|
|
77
82
|
/** Raw source patterns used by middleware */
|
|
78
83
|
middlewareRawSrc?: string[];
|
|
79
84
|
/** Path to the middleware implementation file */
|
|
80
85
|
middlewarePath?: string;
|
|
86
|
+
/** Mitigation action to apply to the route */
|
|
87
|
+
mitigate?: Mitigate;
|
|
88
|
+
/** List of transforms to apply to the route */
|
|
89
|
+
transforms?: Transform[];
|
|
81
90
|
};
|
|
82
91
|
/**
|
|
83
92
|
* Locale configuration for internationalization routing.
|
|
@@ -90,51 +99,52 @@ type Locale = {
|
|
|
90
99
|
cookie?: string;
|
|
91
100
|
};
|
|
92
101
|
/**
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
|
|
96
|
-
type HostHasField = {
|
|
97
|
-
/** Identifies this as a host matching condition */
|
|
98
|
-
type: 'host';
|
|
99
|
-
/** Pattern to match against the Host header */
|
|
100
|
-
value: string;
|
|
101
|
-
};
|
|
102
|
-
/**
|
|
103
|
-
* Header-based condition for route matching.
|
|
104
|
-
* Used to match requests based on HTTP headers.
|
|
102
|
+
* Matchable value for complex route condition matching.
|
|
103
|
+
* Allows matching against values using various comparison operators.
|
|
104
|
+
* @see https://vercel.com/docs/build-output-api/v3/configuration#source-route-matchablevalue
|
|
105
105
|
*/
|
|
106
|
-
type
|
|
107
|
-
/**
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
|
|
106
|
+
type MatchableValue = {
|
|
107
|
+
/** Value must equal this value */
|
|
108
|
+
eq?: string | number;
|
|
109
|
+
/** Value must not equal this value */
|
|
110
|
+
neq?: string;
|
|
111
|
+
/** Value must be included in this array */
|
|
112
|
+
inc?: string[];
|
|
113
|
+
/** Value must not be included in this array */
|
|
114
|
+
ninc?: string[];
|
|
115
|
+
/** Value must start with this prefix */
|
|
116
|
+
pre?: string;
|
|
117
|
+
/** Value must end with this suffix */
|
|
118
|
+
suf?: string;
|
|
119
|
+
/** Value must match this regular expression */
|
|
120
|
+
re?: string;
|
|
121
|
+
/** Value must be greater than this number */
|
|
122
|
+
gt?: number;
|
|
123
|
+
/** Value must be greater than or equal to this number */
|
|
124
|
+
gte?: number;
|
|
125
|
+
/** Value must be less than this number */
|
|
126
|
+
lt?: number;
|
|
127
|
+
/** Value must be less than or equal to this number */
|
|
128
|
+
lte?: number;
|
|
113
129
|
};
|
|
114
130
|
/**
|
|
115
|
-
*
|
|
116
|
-
* Used
|
|
131
|
+
* Condition fields for route matching based on request properties.
|
|
132
|
+
* Used in `has` and `missing` arrays on Source routes.
|
|
133
|
+
* @see https://vercel.com/docs/build-output-api/v3/configuration#source-route-hasfield
|
|
117
134
|
*/
|
|
118
|
-
type
|
|
119
|
-
/** Identifies this as a
|
|
120
|
-
type: '
|
|
121
|
-
/**
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* Query parameter condition for route matching.
|
|
128
|
-
* Used to match requests based on query string parameters.
|
|
129
|
-
*/
|
|
130
|
-
type QueryHasField = {
|
|
131
|
-
/** Identifies this as a query parameter matching condition */
|
|
132
|
-
type: 'query';
|
|
133
|
-
/** Name of the query parameter to match */
|
|
135
|
+
type HasField = Array<{
|
|
136
|
+
/** Identifies this as a host matching condition */
|
|
137
|
+
type: 'host';
|
|
138
|
+
/** Pattern to match against the Host header */
|
|
139
|
+
value: string | MatchableValue;
|
|
140
|
+
} | {
|
|
141
|
+
/** Identifies the condition type: header, cookie, or query parameter */
|
|
142
|
+
type: 'header' | 'cookie' | 'query';
|
|
143
|
+
/** Name of the header, cookie, or query parameter to match */
|
|
134
144
|
key: string;
|
|
135
|
-
/** Optional value the
|
|
136
|
-
value?: string;
|
|
137
|
-
}
|
|
145
|
+
/** Optional value the field should match */
|
|
146
|
+
value?: string | MatchableValue;
|
|
147
|
+
}>;
|
|
138
148
|
/**
|
|
139
149
|
* Special handler phases for request processing.
|
|
140
150
|
* Defines when and how requests should be processed in the routing pipeline.
|
|
@@ -154,9 +164,33 @@ type Handler = {
|
|
|
154
164
|
/** HTTP status code to return in the response */
|
|
155
165
|
status?: number;
|
|
156
166
|
};
|
|
167
|
+
/**
|
|
168
|
+
* Mitigation action to apply to a route.
|
|
169
|
+
* @see https://vercel.com/docs/build-output-api/v3/configuration#source-route-mitigate
|
|
170
|
+
*/
|
|
171
|
+
type Mitigate = {
|
|
172
|
+
/** The mitigation action to apply */
|
|
173
|
+
action: 'challenge' | 'deny';
|
|
174
|
+
};
|
|
175
|
+
/**
|
|
176
|
+
* Transform to apply to request or response properties on a route.
|
|
177
|
+
* @see https://vercel.com/docs/build-output-api/v3/configuration#source-route-transform
|
|
178
|
+
*/
|
|
179
|
+
type Transform = {
|
|
180
|
+
/** The target of the transform: request headers, request query, or response headers */
|
|
181
|
+
type: 'request.headers' | 'request.query' | 'response.headers';
|
|
182
|
+
/** The operation to perform */
|
|
183
|
+
op: 'append' | 'set' | 'delete';
|
|
184
|
+
/** The target key for the transform (regex matching not supported) */
|
|
185
|
+
target: {
|
|
186
|
+
key: string | Omit<MatchableValue, 're'>;
|
|
187
|
+
};
|
|
188
|
+
/** Arguments for the transform operation */
|
|
189
|
+
args?: string | string[];
|
|
190
|
+
};
|
|
157
191
|
/**
|
|
158
192
|
* Supported image formats for the Image Optimization API.
|
|
159
|
-
* @see https://vercel.com/docs/build-output-api/configuration#images
|
|
193
|
+
* @see https://vercel.com/docs/build-output-api/v3/configuration#images
|
|
160
194
|
*/
|
|
161
195
|
type ImageFormat = 'image/avif' | 'image/webp';
|
|
162
196
|
/**
|
|
@@ -187,7 +221,7 @@ type LocalPattern = {
|
|
|
187
221
|
};
|
|
188
222
|
/**
|
|
189
223
|
* Configuration for Vercel's Image Optimization feature.
|
|
190
|
-
* @see https://vercel.com/docs/build-output-api/configuration#images
|
|
224
|
+
* @see https://vercel.com/docs/build-output-api/v3/configuration#images
|
|
191
225
|
*/
|
|
192
226
|
type ImagesConfig = {
|
|
193
227
|
/** Array of allowed image widths for resizing */
|
|
@@ -214,7 +248,7 @@ type ImagesConfig = {
|
|
|
214
248
|
/**
|
|
215
249
|
* Configuration for custom domain wildcards.
|
|
216
250
|
* Used for internationalization and dynamic routing based on domains.
|
|
217
|
-
* @see https://vercel.com/docs/build-output-api/configuration#wildcard
|
|
251
|
+
* @see https://vercel.com/docs/build-output-api/v3/configuration#wildcard
|
|
218
252
|
*/
|
|
219
253
|
type WildCard = {
|
|
220
254
|
/** Domain name to match for this wildcard configuration */
|
|
@@ -224,7 +258,7 @@ type WildCard = {
|
|
|
224
258
|
};
|
|
225
259
|
/**
|
|
226
260
|
* Configuration for path or content-type overrides of static files.
|
|
227
|
-
* @see https://vercel.com/docs/build-output-api/configuration#overrides
|
|
261
|
+
* @see https://vercel.com/docs/build-output-api/v3/configuration#overrides
|
|
228
262
|
*/
|
|
229
263
|
type Override = {
|
|
230
264
|
/** URL path where the static file will be accessible */
|
|
@@ -234,7 +268,7 @@ type Override = {
|
|
|
234
268
|
};
|
|
235
269
|
/**
|
|
236
270
|
* Configuration for scheduled tasks (Cron Jobs).
|
|
237
|
-
* @see https://vercel.com/docs/build-output-api/configuration#crons
|
|
271
|
+
* @see https://vercel.com/docs/build-output-api/v3/configuration#crons
|
|
238
272
|
*/
|
|
239
273
|
type Cron = {
|
|
240
274
|
/** Path to the API route that handles the cron job */
|
|
@@ -243,29 +277,92 @@ type Cron = {
|
|
|
243
277
|
schedule: string;
|
|
244
278
|
};
|
|
245
279
|
/**
|
|
246
|
-
*
|
|
247
|
-
*
|
|
248
|
-
|
|
280
|
+
* Framework metadata for display purposes.
|
|
281
|
+
* @see https://vercel.com/docs/build-output-api/v3/configuration#framework
|
|
282
|
+
*/
|
|
283
|
+
type Framework = {
|
|
284
|
+
/** Framework version string */
|
|
285
|
+
version: string;
|
|
286
|
+
};
|
|
287
|
+
/**
|
|
288
|
+
* Base configuration for a serverless function in Vercel.
|
|
289
|
+
* This type represents the `.vc-config.json` configuration within a `.func` directory.
|
|
290
|
+
* @see https://vercel.com/docs/build-output-api/v3/primitives#serverless-function-configuration
|
|
249
291
|
*/
|
|
250
292
|
type VercelServerlessFunctionConfig = {
|
|
251
|
-
/** Indicates the initial file where code will be executed for the Serverless Function
|
|
252
|
-
handler
|
|
253
|
-
/** Specifies which "
|
|
254
|
-
|
|
255
|
-
/**
|
|
256
|
-
runtime?: `nodejs${number}.x`;
|
|
257
|
-
/** The amount of memory allocated to the function in MB */
|
|
293
|
+
/** Indicates the initial file where code will be executed for the Serverless Function */
|
|
294
|
+
handler: string;
|
|
295
|
+
/** Specifies which "runtime" will be used to execute the Serverless Function */
|
|
296
|
+
runtime: string;
|
|
297
|
+
/** The amount of memory (RAM in MB) allocated to the function */
|
|
258
298
|
memory?: number;
|
|
259
299
|
/** The maximum duration of the function in seconds */
|
|
260
300
|
maxDuration?: number;
|
|
301
|
+
/** Map of additional environment variables available to the function */
|
|
302
|
+
environment?: Record<string, string>;
|
|
261
303
|
/** The regions the function is available in */
|
|
262
304
|
regions?: string[];
|
|
305
|
+
/** Instruction set architecture the function supports */
|
|
306
|
+
architecture?: 'x86_64' | 'arm64';
|
|
307
|
+
/** Whether the custom runtime supports Lambda runtime wrappers */
|
|
308
|
+
supportsWrapper?: boolean;
|
|
263
309
|
/** Whether the function supports response streaming */
|
|
264
310
|
supportsResponseStreaming?: boolean;
|
|
311
|
+
};
|
|
312
|
+
/**
|
|
313
|
+
* Node.js-specific serverless function configuration.
|
|
314
|
+
* Extends the base serverless function config with Node.js launcher options.
|
|
315
|
+
* @see https://vercel.com/docs/build-output-api/v3/primitives#nodejs-config
|
|
316
|
+
*/
|
|
317
|
+
type VercelNodejsServerlessFunctionConfig = VercelServerlessFunctionConfig & {
|
|
318
|
+
/** Specifies which "launcher" will be used to execute the Serverless Function */
|
|
319
|
+
launcherType: 'Nodejs';
|
|
265
320
|
/** Enables request and response helpers methods */
|
|
266
321
|
shouldAddHelpers?: boolean;
|
|
267
322
|
/** Enables source map generation */
|
|
268
323
|
shouldAddSourcemapSupport?: boolean;
|
|
324
|
+
/** AWS Handler Value for when the serverless function uses AWS Lambda syntax */
|
|
325
|
+
awsLambdaHandler?: string;
|
|
326
|
+
};
|
|
327
|
+
/**
|
|
328
|
+
* Configuration for an Edge Function in Vercel.
|
|
329
|
+
* This type represents the `.vc-config.json` configuration for Edge Functions.
|
|
330
|
+
* @see https://vercel.com/docs/build-output-api/v3/primitives#edge-function-configuration
|
|
331
|
+
*/
|
|
332
|
+
type VercelEdgeFunctionConfig = {
|
|
333
|
+
/** Must be 'edge' to indicate this is an Edge Function */
|
|
334
|
+
runtime: 'edge';
|
|
335
|
+
/** Initial file where code will be executed for the Edge Function */
|
|
336
|
+
entrypoint: string;
|
|
337
|
+
/** List of environment variable names available to the Edge Function */
|
|
338
|
+
envVarsInUse?: string[];
|
|
339
|
+
/** Regions the edge function will be available in (defaults to 'all') */
|
|
340
|
+
regions?: 'all' | string | string[];
|
|
341
|
+
};
|
|
342
|
+
/**
|
|
343
|
+
* Configuration for a Prerender Function in Vercel (ISR).
|
|
344
|
+
* This type represents the `.prerender-config.json` configuration file.
|
|
345
|
+
* @see https://vercel.com/docs/build-output-api/v3/primitives#prerender-configuration-file
|
|
346
|
+
*/
|
|
347
|
+
type VercelPrerenderFunctionConfig = {
|
|
348
|
+
/** Cache expiration time in seconds, or false to never expire */
|
|
349
|
+
expiration: number | false;
|
|
350
|
+
/** Group number for co-revalidating prerender assets together */
|
|
351
|
+
group?: number;
|
|
352
|
+
/** Random token for Draft Mode bypass cookie (`__prerender_bypass`) */
|
|
353
|
+
bypassToken?: string;
|
|
354
|
+
/** Name of the optional fallback file relative to the configuration file */
|
|
355
|
+
fallback?: string;
|
|
356
|
+
/** Query string parameter names that will be cached independently */
|
|
357
|
+
allowQuery?: string[];
|
|
358
|
+
/** When true, the query string will be present on the request argument */
|
|
359
|
+
passQuery?: boolean;
|
|
360
|
+
/** Initial headers to include with the build-time prerendered response */
|
|
361
|
+
initialHeaders?: Record<string, string>;
|
|
362
|
+
/** Initial HTTP status code for the build-time prerendered response (default 200) */
|
|
363
|
+
initialStatus?: number;
|
|
364
|
+
/** When true, expose the response body regardless of status code including errors */
|
|
365
|
+
exposeErrBody?: boolean;
|
|
269
366
|
};
|
|
270
367
|
|
|
271
|
-
export { VercelBuildConfigV3, VercelServerlessFunctionConfig };
|
|
368
|
+
export { VercelBuildConfigV3, VercelEdgeFunctionConfig, VercelNodejsServerlessFunctionConfig, VercelPrerenderFunctionConfig, VercelServerlessFunctionConfig };
|
package/dist/base.js
CHANGED