vite 3.0.4 → 3.0.5
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/bin/vite.js +1 -1
- package/dist/node/chunks/{dep-3811dadb.js → dep-0f192b10.js} +1 -1
- package/dist/node/chunks/{dep-71eb12cb.js → dep-5cb728cb.js} +240 -142
- package/dist/node/chunks/{dep-41eb528c.js → dep-94c1417a.js} +0 -0
- package/dist/node/chunks/{dep-f135d593.js → dep-b58adab6.js} +1 -1
- package/dist/node/cli.js +6 -6
- package/dist/node/constants.js +1 -1
- package/dist/node/index.d.ts +148 -49
- package/dist/node/index.js +2 -2
- package/dist/node-cjs/publicUtils.cjs +2 -2
- package/package.json +9 -9
- package/types/commonjs.d.ts +61 -13
- package/types/connect.d.ts +1 -1
- package/types/http-proxy.d.ts +41 -33
- package/types/terser.d.ts +43 -0
- package/types/ws.d.ts +1 -1
package/types/http-proxy.d.ts
CHANGED
|
@@ -27,16 +27,16 @@ export namespace HttpProxy {
|
|
|
27
27
|
export interface ProxyTargetDetailed {
|
|
28
28
|
host: string
|
|
29
29
|
port: number
|
|
30
|
-
protocol?: string
|
|
31
|
-
hostname?: string
|
|
32
|
-
socketPath?: string
|
|
33
|
-
key?: string
|
|
34
|
-
passphrase?: string
|
|
35
|
-
pfx?: Buffer | string
|
|
36
|
-
cert?: string
|
|
37
|
-
ca?: string
|
|
38
|
-
ciphers?: string
|
|
39
|
-
secureProtocol?: string
|
|
30
|
+
protocol?: string | undefined
|
|
31
|
+
hostname?: string | undefined
|
|
32
|
+
socketPath?: string | undefined
|
|
33
|
+
key?: string | undefined
|
|
34
|
+
passphrase?: string | undefined
|
|
35
|
+
pfx?: Buffer | string | undefined
|
|
36
|
+
cert?: string | undefined
|
|
37
|
+
ca?: string | undefined
|
|
38
|
+
ciphers?: string | undefined
|
|
39
|
+
secureProtocol?: string | undefined
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
export type ErrorCallback = (
|
|
@@ -189,54 +189,62 @@ export namespace HttpProxy {
|
|
|
189
189
|
|
|
190
190
|
export interface ServerOptions {
|
|
191
191
|
/** URL string to be parsed with the url module. */
|
|
192
|
-
target?: ProxyTarget
|
|
192
|
+
target?: ProxyTarget | undefined
|
|
193
193
|
/** URL string to be parsed with the url module. */
|
|
194
|
-
forward?: ProxyTargetUrl
|
|
194
|
+
forward?: ProxyTargetUrl | undefined
|
|
195
195
|
/** Object to be passed to http(s).request. */
|
|
196
196
|
agent?: any
|
|
197
197
|
/** Object to be passed to https.createServer(). */
|
|
198
198
|
ssl?: any
|
|
199
199
|
/** If you want to proxy websockets. */
|
|
200
|
-
ws?: boolean
|
|
200
|
+
ws?: boolean | undefined
|
|
201
201
|
/** Adds x- forward headers. */
|
|
202
|
-
xfwd?: boolean
|
|
202
|
+
xfwd?: boolean | undefined
|
|
203
203
|
/** Verify SSL certificate. */
|
|
204
|
-
secure?: boolean
|
|
204
|
+
secure?: boolean | undefined
|
|
205
205
|
/** Explicitly specify if we are proxying to another proxy. */
|
|
206
|
-
toProxy?: boolean
|
|
206
|
+
toProxy?: boolean | undefined
|
|
207
207
|
/** Specify whether you want to prepend the target's path to the proxy path. */
|
|
208
|
-
prependPath?: boolean
|
|
208
|
+
prependPath?: boolean | undefined
|
|
209
209
|
/** Specify whether you want to ignore the proxy path of the incoming request. */
|
|
210
|
-
ignorePath?: boolean
|
|
210
|
+
ignorePath?: boolean | undefined
|
|
211
211
|
/** Local interface string to bind for outgoing connections. */
|
|
212
|
-
localAddress?: string
|
|
212
|
+
localAddress?: string | undefined
|
|
213
213
|
/** Changes the origin of the host header to the target URL. */
|
|
214
|
-
changeOrigin?: boolean
|
|
214
|
+
changeOrigin?: boolean | undefined
|
|
215
215
|
/** specify whether you want to keep letter case of response header key */
|
|
216
|
-
preserveHeaderKeyCase?: boolean
|
|
216
|
+
preserveHeaderKeyCase?: boolean | undefined
|
|
217
217
|
/** Basic authentication i.e. 'user:password' to compute an Authorization header. */
|
|
218
|
-
auth?: string
|
|
218
|
+
auth?: string | undefined
|
|
219
219
|
/** Rewrites the location hostname on (301 / 302 / 307 / 308) redirects, Default: null. */
|
|
220
|
-
hostRewrite?: string
|
|
220
|
+
hostRewrite?: string | undefined
|
|
221
221
|
/** Rewrites the location host/ port on (301 / 302 / 307 / 308) redirects based on requested host/ port.Default: false. */
|
|
222
|
-
autoRewrite?: boolean
|
|
222
|
+
autoRewrite?: boolean | undefined
|
|
223
223
|
/** Rewrites the location protocol on (301 / 302 / 307 / 308) redirects to 'http' or 'https'.Default: null. */
|
|
224
|
-
protocolRewrite?: string
|
|
224
|
+
protocolRewrite?: string | undefined
|
|
225
225
|
/** rewrites domain of set-cookie headers. */
|
|
226
|
-
cookieDomainRewrite?:
|
|
226
|
+
cookieDomainRewrite?:
|
|
227
|
+
| false
|
|
228
|
+
| string
|
|
229
|
+
| { [oldDomain: string]: string }
|
|
230
|
+
| undefined
|
|
227
231
|
/** rewrites path of set-cookie headers. Default: false */
|
|
228
|
-
cookiePathRewrite?:
|
|
232
|
+
cookiePathRewrite?:
|
|
233
|
+
| false
|
|
234
|
+
| string
|
|
235
|
+
| { [oldPath: string]: string }
|
|
236
|
+
| undefined
|
|
229
237
|
/** object with extra headers to be added to target requests. */
|
|
230
|
-
headers?: { [header: string]: string }
|
|
238
|
+
headers?: { [header: string]: string } | undefined
|
|
231
239
|
/** Timeout (in milliseconds) when proxy receives no response from target. Default: 120000 (2 minutes) */
|
|
232
|
-
proxyTimeout?: number
|
|
240
|
+
proxyTimeout?: number | undefined
|
|
233
241
|
/** Timeout (in milliseconds) for incoming requests */
|
|
234
|
-
timeout?: number
|
|
242
|
+
timeout?: number | undefined
|
|
235
243
|
/** Specify whether you want to follow redirects. Default: false */
|
|
236
|
-
followRedirects?: boolean
|
|
244
|
+
followRedirects?: boolean | undefined
|
|
237
245
|
/** If set to true, none of the webOutgoing passes are called and it's your responsibility to appropriately return the response by listening and acting on the proxyRes event */
|
|
238
|
-
selfHandleResponse?: boolean
|
|
246
|
+
selfHandleResponse?: boolean | undefined
|
|
239
247
|
/** Buffer */
|
|
240
|
-
buffer?: stream.Stream
|
|
248
|
+
buffer?: stream.Stream | undefined
|
|
241
249
|
}
|
|
242
250
|
}
|
package/types/terser.d.ts
CHANGED
|
@@ -39,6 +39,7 @@ export namespace Terser {
|
|
|
39
39
|
|
|
40
40
|
export interface ParseOptions {
|
|
41
41
|
bare_returns?: boolean
|
|
42
|
+
/** @deprecated legacy option. Currently, all supported EcmaScript is valid to parse. */
|
|
42
43
|
ecma?: ECMA
|
|
43
44
|
html5_comments?: boolean
|
|
44
45
|
shebang?: boolean
|
|
@@ -113,22 +114,59 @@ export namespace Terser {
|
|
|
113
114
|
keep_classnames?: boolean | RegExp
|
|
114
115
|
keep_fnames?: boolean | RegExp
|
|
115
116
|
module?: boolean
|
|
117
|
+
nth_identifier?: SimpleIdentifierMangler | WeightedIdentifierMangler
|
|
116
118
|
properties?: boolean | ManglePropertiesOptions
|
|
117
119
|
reserved?: string[]
|
|
118
120
|
safari10?: boolean
|
|
119
121
|
toplevel?: boolean
|
|
120
122
|
}
|
|
121
123
|
|
|
124
|
+
/**
|
|
125
|
+
* An identifier mangler for which the output is invariant with respect to the source code.
|
|
126
|
+
*/
|
|
127
|
+
export interface SimpleIdentifierMangler {
|
|
128
|
+
/**
|
|
129
|
+
* Obtains the nth most favored (usually shortest) identifier to rename a variable to.
|
|
130
|
+
* The mangler will increment n and retry until the return value is not in use in scope, and is not a reserved word.
|
|
131
|
+
* This function is expected to be stable; Evaluating get(n) === get(n) should always return true.
|
|
132
|
+
* @param n - The ordinal of the identifier.
|
|
133
|
+
*/
|
|
134
|
+
get(n: number): string
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* An identifier mangler that leverages character frequency analysis to determine identifier precedence.
|
|
139
|
+
*/
|
|
140
|
+
export interface WeightedIdentifierMangler extends SimpleIdentifierMangler {
|
|
141
|
+
/**
|
|
142
|
+
* Modifies the internal weighting of the input characters by the specified delta.
|
|
143
|
+
* Will be invoked on the entire printed AST, and then deduct mangleable identifiers.
|
|
144
|
+
* @param chars - The characters to modify the weighting of.
|
|
145
|
+
* @param delta - The numeric weight to add to the characters.
|
|
146
|
+
*/
|
|
147
|
+
consider(chars: string, delta: number): number
|
|
148
|
+
/**
|
|
149
|
+
* Resets character weights.
|
|
150
|
+
*/
|
|
151
|
+
reset(): void
|
|
152
|
+
/**
|
|
153
|
+
* Sorts identifiers by character frequency, in preparation for calls to get(n).
|
|
154
|
+
*/
|
|
155
|
+
sort(): void
|
|
156
|
+
}
|
|
157
|
+
|
|
122
158
|
export interface ManglePropertiesOptions {
|
|
123
159
|
builtins?: boolean
|
|
124
160
|
debug?: boolean
|
|
125
161
|
keep_quoted?: boolean | 'strict'
|
|
162
|
+
nth_identifier?: SimpleIdentifierMangler | WeightedIdentifierMangler
|
|
126
163
|
regex?: RegExp | string
|
|
127
164
|
reserved?: string[]
|
|
128
165
|
}
|
|
129
166
|
|
|
130
167
|
export interface FormatOptions {
|
|
131
168
|
ascii_only?: boolean
|
|
169
|
+
/** @deprecated Not implemented anymore */
|
|
132
170
|
beautify?: boolean
|
|
133
171
|
braces?: boolean
|
|
134
172
|
comments?:
|
|
@@ -148,6 +186,7 @@ export namespace Terser {
|
|
|
148
186
|
) => boolean)
|
|
149
187
|
ecma?: ECMA
|
|
150
188
|
ie8?: boolean
|
|
189
|
+
keep_numbers?: boolean
|
|
151
190
|
indent_level?: number
|
|
152
191
|
indent_start?: number
|
|
153
192
|
inline_script?: boolean
|
|
@@ -178,6 +217,7 @@ export namespace Terser {
|
|
|
178
217
|
export interface MinifyOptions {
|
|
179
218
|
compress?: boolean | CompressOptions
|
|
180
219
|
ecma?: ECMA
|
|
220
|
+
enclose?: boolean | string
|
|
181
221
|
ie8?: boolean
|
|
182
222
|
keep_classnames?: boolean | RegExp
|
|
183
223
|
keep_fnames?: boolean | RegExp
|
|
@@ -185,6 +225,8 @@ export namespace Terser {
|
|
|
185
225
|
module?: boolean
|
|
186
226
|
nameCache?: object
|
|
187
227
|
format?: FormatOptions
|
|
228
|
+
/** @deprecated deprecated */
|
|
229
|
+
output?: FormatOptions
|
|
188
230
|
parse?: ParseOptions
|
|
189
231
|
safari10?: boolean
|
|
190
232
|
sourceMap?: boolean | SourceMapOptions
|
|
@@ -194,6 +236,7 @@ export namespace Terser {
|
|
|
194
236
|
export interface MinifyOutput {
|
|
195
237
|
code?: string
|
|
196
238
|
map?: object | string
|
|
239
|
+
decoded_map?: object | null
|
|
197
240
|
}
|
|
198
241
|
|
|
199
242
|
export interface SourceMapOptions {
|
package/types/ws.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ import type {
|
|
|
26
26
|
} from 'node:http'
|
|
27
27
|
import type { Server as HTTPSServer } from 'node:https'
|
|
28
28
|
import type { Duplex, DuplexOptions } from 'node:stream'
|
|
29
|
-
import type { SecureContextOptions } from 'tls'
|
|
29
|
+
import type { SecureContextOptions } from 'node:tls'
|
|
30
30
|
import type { URL } from 'node:url'
|
|
31
31
|
import type { ZlibOptions } from 'node:zlib'
|
|
32
32
|
|