-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.ts
91 lines (83 loc) · 2.14 KB
/
types.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
import type { RspackOptions, HtmlRspackPluginOptions, CopyRspackPluginOptions } from '@rspack/core'
import type { Options as InjectManifestOptions } from 'inject-manifest-plugin'
type Unpacked<T> = T extends (infer U)[] ? U : T
export type HtmlOptions = Unpacked<HtmlRspackPluginOptions>
export type CopyOptions = CopyRspackPluginOptions
interface Rewrite {
source: string
destination: string
}
interface Redirect extends Rewrite {
type: number
}
interface Header {
source: string
headers: Array<{
key: string
value: string
}>
}
// NOTE types not exported by serve-handler.
export interface ServeConfig {
public?: string | undefined
cleanUrls?: boolean | string[] | undefined
rewrites?: Rewrite[] | undefined
redirects?: Redirect[] | undefined
headers?: Header[] | undefined
directoryListing?: boolean | string[] | undefined
unlisted?: string[] | undefined
trailingSlash?: boolean | undefined
renderSingle?: boolean | undefined
symlinks?: boolean | undefined
etag?: boolean | undefined
}
export type Dependencies = { [key: string]: string }
export interface Options {
output: string
react: boolean
entry: NormalizedEntry
typescript: boolean
test: false | string
publicPath: string
injectManifest: InjectManifestOptions | false
hasTest: boolean
title: string
html: boolean | HtmlOptions
icon: boolean | string
hash: boolean
root: boolean
serve?: ServeConfig
localDependencies: boolean
sourceMap: boolean
esVersion?: Unpacked<RspackOptions['target']>
envVariables: string[]
}
export interface Package {
$schema?: string
name?: string
version?: string
papua?: Partial<Options>
dependencies?: Dependencies
devDependencies?: Dependencies
peerDependencies?: Dependencies
localDependencies?: Dependencies
scripts?: {
start?: string
build?: string
test?: string
}
type: 'module'
main?: string
engines: {
node?: string
}
prettier: string
eslintConfig?: {
extends?: string
}
stylelint?: {
extends?: string
}
}
export type Entry = string | string[] | { [key: string]: string | string[] }
export type NormalizedEntry = string[] | { [key: string]: string[] }