@ohos-ports/rsbuild-core 1.1.14-beta.1
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/LICENSE +21 -0
- package/README.md +28 -0
- package/bin/rsbuild.js +20 -0
- package/compiled/chokidar/index.d.ts +345 -0
- package/compiled/chokidar/index.js +1778 -0
- package/compiled/chokidar/license +21 -0
- package/compiled/chokidar/package.json +1 -0
- package/compiled/connect/index.d.ts +90 -0
- package/compiled/connect/index.js +1240 -0
- package/compiled/connect/license +25 -0
- package/compiled/connect/package.json +1 -0
- package/compiled/connect-history-api-fallback/index.d.ts +1 -0
- package/compiled/connect-history-api-fallback/index.js +149 -0
- package/compiled/connect-history-api-fallback/license +21 -0
- package/compiled/connect-history-api-fallback/package.json +1 -0
- package/compiled/cors/index.d.ts +1 -0
- package/compiled/cors/index.js +371 -0
- package/compiled/cors/license +22 -0
- package/compiled/cors/package.json +1 -0
- package/compiled/css-loader/api.js +85 -0
- package/compiled/css-loader/getUrl.js +26 -0
- package/compiled/css-loader/index.d.ts +1 -0
- package/compiled/css-loader/index.js +8008 -0
- package/compiled/css-loader/license +20 -0
- package/compiled/css-loader/noSourceMaps.js +5 -0
- package/compiled/css-loader/package.json +1 -0
- package/compiled/css-loader/sourceMaps.js +16 -0
- package/compiled/html-rspack-plugin/default_index.ejs +9 -0
- package/compiled/html-rspack-plugin/index.d.ts +289 -0
- package/compiled/html-rspack-plugin/index.js +1583 -0
- package/compiled/html-rspack-plugin/license +20 -0
- package/compiled/html-rspack-plugin/loader.js +162 -0
- package/compiled/html-rspack-plugin/package.json +1 -0
- package/compiled/http-proxy-middleware/index.d.ts +318 -0
- package/compiled/http-proxy-middleware/index.js +5280 -0
- package/compiled/http-proxy-middleware/license +22 -0
- package/compiled/http-proxy-middleware/package.json +1 -0
- package/compiled/jiti/index.d.ts +1 -0
- package/compiled/jiti/index.js +416 -0
- package/compiled/jiti/license +21 -0
- package/compiled/jiti/package.json +1 -0
- package/compiled/launch-editor-middleware/index.d.ts +1 -0
- package/compiled/launch-editor-middleware/index.js +694 -0
- package/compiled/launch-editor-middleware/license +21 -0
- package/compiled/launch-editor-middleware/package.json +1 -0
- package/compiled/mrmime/index.d.ts +4 -0
- package/compiled/mrmime/index.js +452 -0
- package/compiled/mrmime/package.json +1 -0
- package/compiled/on-finished/index.d.ts +13 -0
- package/compiled/on-finished/index.js +197 -0
- package/compiled/on-finished/license +23 -0
- package/compiled/on-finished/package.json +1 -0
- package/compiled/open/index.d.ts +153 -0
- package/compiled/open/index.js +409 -0
- package/compiled/open/package.json +1 -0
- package/compiled/open/xdg-open +1066 -0
- package/compiled/picocolors/index.d.ts +55 -0
- package/compiled/picocolors/index.js +108 -0
- package/compiled/picocolors/license +15 -0
- package/compiled/picocolors/package.json +1 -0
- package/compiled/postcss/index.d.ts +1 -0
- package/compiled/postcss/index.js +5997 -0
- package/compiled/postcss/license +20 -0
- package/compiled/postcss/package.json +1 -0
- package/compiled/postcss-load-config/index.d.ts +1 -0
- package/compiled/postcss-load-config/index.js +739 -0
- package/compiled/postcss-load-config/license +20 -0
- package/compiled/postcss-load-config/package.json +1 -0
- package/compiled/postcss-loader/index.d.ts +1 -0
- package/compiled/postcss-loader/index.js +741 -0
- package/compiled/postcss-loader/license +20 -0
- package/compiled/postcss-loader/package.json +1 -0
- package/compiled/rsbuild-dev-middleware/index.d.ts +1 -0
- package/compiled/rsbuild-dev-middleware/index.js +6158 -0
- package/compiled/rsbuild-dev-middleware/license +20 -0
- package/compiled/rsbuild-dev-middleware/package.json +1 -0
- package/compiled/rslog/index.d.ts +66 -0
- package/compiled/rslog/index.js +334 -0
- package/compiled/rslog/license +21 -0
- package/compiled/rslog/package.json +1 -0
- package/compiled/rspack-chain/index.d.ts +611 -0
- package/compiled/rspack-chain/index.js +1740 -0
- package/compiled/rspack-chain/license +373 -0
- package/compiled/rspack-chain/package.json +1 -0
- package/compiled/rspack-manifest-plugin/index.d.ts +44 -0
- package/compiled/rspack-manifest-plugin/index.js +394 -0
- package/compiled/rspack-manifest-plugin/license +21 -0
- package/compiled/rspack-manifest-plugin/package.json +1 -0
- package/compiled/sirv/index.d.ts +1 -0
- package/compiled/sirv/index.js +709 -0
- package/compiled/sirv/package.json +1 -0
- package/compiled/style-loader/index.d.ts +1 -0
- package/compiled/style-loader/index.js +427 -0
- package/compiled/style-loader/license +20 -0
- package/compiled/style-loader/package.json +1 -0
- package/compiled/style-loader/runtime/injectStylesIntoLinkTag.js +29 -0
- package/compiled/style-loader/runtime/injectStylesIntoStyleTag.js +84 -0
- package/compiled/style-loader/runtime/insertBySelector.js +34 -0
- package/compiled/style-loader/runtime/insertStyleElement.js +10 -0
- package/compiled/style-loader/runtime/isEqualLocals.js +28 -0
- package/compiled/style-loader/runtime/isOldIE.js +17 -0
- package/compiled/style-loader/runtime/setAttributesWithAttributes.js +13 -0
- package/compiled/style-loader/runtime/setAttributesWithAttributesAndNonce.js +9 -0
- package/compiled/style-loader/runtime/setAttributesWithoutAttributes.js +10 -0
- package/compiled/style-loader/runtime/singletonStyleDomAPI.js +86 -0
- package/compiled/style-loader/runtime/styleDomAPI.js +61 -0
- package/compiled/style-loader/runtime/styleTagTransform.js +14 -0
- package/compiled/tinyglobby/index.d.ts +25 -0
- package/compiled/tinyglobby/index.js +2749 -0
- package/compiled/tinyglobby/index1.js +17 -0
- package/compiled/tinyglobby/license +21 -0
- package/compiled/tinyglobby/package.json +1 -0
- package/compiled/webpack-bundle-analyzer/index.d.ts +160 -0
- package/compiled/webpack-bundle-analyzer/index.js +13480 -0
- package/compiled/webpack-bundle-analyzer/license +20 -0
- package/compiled/webpack-bundle-analyzer/package.json +1 -0
- package/compiled/webpack-bundle-analyzer/public/viewer.js +16 -0
- package/compiled/webpack-bundle-analyzer/public/viewer.js.LICENSE.txt +10 -0
- package/compiled/webpack-merge/index.d.ts +31 -0
- package/compiled/webpack-merge/index.js +1200 -0
- package/compiled/webpack-merge/license +20 -0
- package/compiled/webpack-merge/package.json +1 -0
- package/compiled/ws/index.d.ts +401 -0
- package/compiled/ws/index.js +3153 -0
- package/compiled/ws/license +20 -0
- package/compiled/ws/package.json +1 -0
- package/dist/client/hmr.js +143 -0
- package/dist/client/overlay.js +210 -0
- package/dist/ignoreCssLoader.mjs +4 -0
- package/dist/index.cjs +7251 -0
- package/dist/index.js +7118 -0
- package/dist/transformLoader.mjs +22 -0
- package/dist/transformRawLoader.mjs +22 -0
- package/dist-types/cli/commands.d.ts +23 -0
- package/dist-types/cli/index.d.ts +1 -0
- package/dist-types/cli/init.d.ts +7 -0
- package/dist-types/cli/prepare.d.ts +1 -0
- package/dist-types/client/hmr.d.ts +1 -0
- package/dist-types/client/overlay.d.ts +1 -0
- package/dist-types/config.d.ts +90 -0
- package/dist-types/configChain.d.ts +139 -0
- package/dist-types/constants.d.ts +37 -0
- package/dist-types/createContext.d.ts +11 -0
- package/dist-types/createRsbuild.d.ts +2 -0
- package/dist-types/helpers/format.d.ts +5 -0
- package/dist-types/helpers/fs.d.ts +13 -0
- package/dist-types/helpers/index.d.ts +47 -0
- package/dist-types/helpers/path.d.ts +11 -0
- package/dist-types/helpers/stats.d.ts +9 -0
- package/dist-types/hooks.d.ts +48 -0
- package/dist-types/index.d.ts +26 -0
- package/dist-types/initPlugins.d.ts +6 -0
- package/dist-types/internal.d.ts +6 -0
- package/dist-types/loadEnv.d.ts +50 -0
- package/dist-types/loader/ignoreCssLoader.d.ts +2 -0
- package/dist-types/loader/transformLoader.d.ts +7 -0
- package/dist-types/loader/transformRawLoader.d.ts +3 -0
- package/dist-types/logger.d.ts +4 -0
- package/dist-types/mergeConfig.d.ts +2 -0
- package/dist-types/package.json +1 -0
- package/dist-types/pluginHelper.d.ts +12 -0
- package/dist-types/pluginManager.d.ts +9 -0
- package/dist-types/plugins/appIcon.d.ts +2 -0
- package/dist-types/plugins/asset.d.ts +3 -0
- package/dist-types/plugins/basic.d.ts +5 -0
- package/dist-types/plugins/bundleAnalyzer.d.ts +2 -0
- package/dist-types/plugins/cache.d.ts +2 -0
- package/dist-types/plugins/cleanOutput.d.ts +3 -0
- package/dist-types/plugins/css.d.ts +3 -0
- package/dist-types/plugins/define.d.ts +2 -0
- package/dist-types/plugins/entry.d.ts +2 -0
- package/dist-types/plugins/externals.d.ts +2 -0
- package/dist-types/plugins/fileSize.d.ts +4 -0
- package/dist-types/plugins/html.d.ts +9 -0
- package/dist-types/plugins/inlineChunk.d.ts +2 -0
- package/dist-types/plugins/lazyCompilation.d.ts +2 -0
- package/dist-types/plugins/manifest.d.ts +2 -0
- package/dist-types/plugins/minimize.d.ts +10 -0
- package/dist-types/plugins/moduleFederation.d.ts +2 -0
- package/dist-types/plugins/moment.d.ts +2 -0
- package/dist-types/plugins/nodeAddons.d.ts +2 -0
- package/dist-types/plugins/nonce.d.ts +2 -0
- package/dist-types/plugins/output.d.ts +2 -0
- package/dist-types/plugins/performance.d.ts +5 -0
- package/dist-types/plugins/progress.d.ts +2 -0
- package/dist-types/plugins/resolve.d.ts +2 -0
- package/dist-types/plugins/resourceHints.d.ts +2 -0
- package/dist-types/plugins/rsdoctor.d.ts +2 -0
- package/dist-types/plugins/rspackProfile.d.ts +2 -0
- package/dist-types/plugins/server.d.ts +2 -0
- package/dist-types/plugins/splitChunks.d.ts +4 -0
- package/dist-types/plugins/sri.d.ts +2 -0
- package/dist-types/plugins/swc.d.ts +7 -0
- package/dist-types/plugins/target.d.ts +2 -0
- package/dist-types/plugins/wasm.d.ts +2 -0
- package/dist-types/provider/build.d.ts +3 -0
- package/dist-types/provider/createCompiler.d.ts +27 -0
- package/dist-types/provider/helpers.d.ts +12 -0
- package/dist-types/provider/initConfigs.d.ts +10 -0
- package/dist-types/provider/inspectConfig.d.ts +6 -0
- package/dist-types/provider/provider.d.ts +2 -0
- package/dist-types/provider/rspackConfig.d.ts +8 -0
- package/dist-types/rspack/RsbuildHtmlPlugin.d.ts +37 -0
- package/dist-types/rspack/preload/HtmlPreloadOrPrefetchPlugin.d.ts +29 -0
- package/dist-types/rspack/preload/helpers/determineAsValue.d.ts +22 -0
- package/dist-types/rspack/preload/helpers/doesChunkBelongToHtml.d.ts +29 -0
- package/dist-types/rspack/preload/helpers/extractChunks.d.ts +28 -0
- package/dist-types/rspack/preload/helpers/index.d.ts +4 -0
- package/dist-types/rspack/preload/helpers/type.d.ts +13 -0
- package/dist-types/server/ansiHTML.d.ts +12 -0
- package/dist-types/server/cliShortcuts.d.ts +10 -0
- package/dist-types/server/compilerDevMiddleware.d.ts +31 -0
- package/dist-types/server/devMiddleware.d.ts +27 -0
- package/dist-types/server/devServer.d.ts +60 -0
- package/dist-types/server/environment.d.ts +8 -0
- package/dist-types/server/getDevMiddlewares.d.ts +25 -0
- package/dist-types/server/gzipMiddleware.d.ts +4 -0
- package/dist-types/server/helper.d.ts +71 -0
- package/dist-types/server/httpServer.d.ts +8 -0
- package/dist-types/server/middlewares.d.ts +34 -0
- package/dist-types/server/open.d.ts +10 -0
- package/dist-types/server/prodServer.d.ts +25 -0
- package/dist-types/server/proxy.d.ts +6 -0
- package/dist-types/server/restart.d.ts +14 -0
- package/dist-types/server/runner/asModule.d.ts +2 -0
- package/dist-types/server/runner/basic.d.ts +25 -0
- package/dist-types/server/runner/cjs.d.ts +10 -0
- package/dist-types/server/runner/esm.d.ts +6 -0
- package/dist-types/server/runner/index.d.ts +8 -0
- package/dist-types/server/runner/type.d.ts +36 -0
- package/dist-types/server/socketServer.d.ts +26 -0
- package/dist-types/server/watchFiles.d.ts +14 -0
- package/dist-types/types/config.d.ts +1309 -0
- package/dist-types/types/context.d.ts +52 -0
- package/dist-types/types/hooks.d.ts +146 -0
- package/dist-types/types/index.d.ts +8 -0
- package/dist-types/types/plugin.d.ts +329 -0
- package/dist-types/types/rsbuild.d.ts +156 -0
- package/dist-types/types/rspack.d.ts +16 -0
- package/dist-types/types/thirdParty.d.ts +176 -0
- package/dist-types/types/utils.d.ts +12 -0
- package/package.json +61 -0
- package/static/openChrome.applescript +95 -0
- package/types.d.ts +221 -0
|
@@ -0,0 +1,709 @@
|
|
|
1
|
+
(() => {
|
|
2
|
+
var __webpack_modules__ = {
|
|
3
|
+
472: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
4
|
+
const qs = __nccwpck_require__(477);
|
|
5
|
+
function parse(req) {
|
|
6
|
+
let raw = req.url;
|
|
7
|
+
if (raw == null) return;
|
|
8
|
+
let prev = req._parsedUrl;
|
|
9
|
+
if (prev && prev.raw === raw) return prev;
|
|
10
|
+
let pathname = raw,
|
|
11
|
+
search = "",
|
|
12
|
+
query;
|
|
13
|
+
if (raw.length > 1) {
|
|
14
|
+
let idx = raw.indexOf("?", 1);
|
|
15
|
+
if (idx !== -1) {
|
|
16
|
+
search = raw.substring(idx);
|
|
17
|
+
pathname = raw.substring(0, idx);
|
|
18
|
+
if (search.length > 1) {
|
|
19
|
+
query = qs.parse(search.substring(1));
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return (req._parsedUrl = { pathname, search, query, raw });
|
|
24
|
+
}
|
|
25
|
+
exports.parse = parse;
|
|
26
|
+
},
|
|
27
|
+
486: (__unused_webpack_module, exports) => {
|
|
28
|
+
const mimes = {
|
|
29
|
+
"3g2": "video/3gpp2",
|
|
30
|
+
"3gp": "video/3gpp",
|
|
31
|
+
"3gpp": "video/3gpp",
|
|
32
|
+
"3mf": "model/3mf",
|
|
33
|
+
aac: "audio/aac",
|
|
34
|
+
ac: "application/pkix-attr-cert",
|
|
35
|
+
adp: "audio/adpcm",
|
|
36
|
+
adts: "audio/aac",
|
|
37
|
+
ai: "application/postscript",
|
|
38
|
+
aml: "application/automationml-aml+xml",
|
|
39
|
+
amlx: "application/automationml-amlx+zip",
|
|
40
|
+
amr: "audio/amr",
|
|
41
|
+
apng: "image/apng",
|
|
42
|
+
appcache: "text/cache-manifest",
|
|
43
|
+
appinstaller: "application/appinstaller",
|
|
44
|
+
appx: "application/appx",
|
|
45
|
+
appxbundle: "application/appxbundle",
|
|
46
|
+
asc: "application/pgp-keys",
|
|
47
|
+
atom: "application/atom+xml",
|
|
48
|
+
atomcat: "application/atomcat+xml",
|
|
49
|
+
atomdeleted: "application/atomdeleted+xml",
|
|
50
|
+
atomsvc: "application/atomsvc+xml",
|
|
51
|
+
au: "audio/basic",
|
|
52
|
+
avci: "image/avci",
|
|
53
|
+
avcs: "image/avcs",
|
|
54
|
+
avif: "image/avif",
|
|
55
|
+
aw: "application/applixware",
|
|
56
|
+
bdoc: "application/bdoc",
|
|
57
|
+
bin: "application/octet-stream",
|
|
58
|
+
bmp: "image/bmp",
|
|
59
|
+
bpk: "application/octet-stream",
|
|
60
|
+
btf: "image/prs.btif",
|
|
61
|
+
btif: "image/prs.btif",
|
|
62
|
+
buffer: "application/octet-stream",
|
|
63
|
+
ccxml: "application/ccxml+xml",
|
|
64
|
+
cdfx: "application/cdfx+xml",
|
|
65
|
+
cdmia: "application/cdmi-capability",
|
|
66
|
+
cdmic: "application/cdmi-container",
|
|
67
|
+
cdmid: "application/cdmi-domain",
|
|
68
|
+
cdmio: "application/cdmi-object",
|
|
69
|
+
cdmiq: "application/cdmi-queue",
|
|
70
|
+
cer: "application/pkix-cert",
|
|
71
|
+
cgm: "image/cgm",
|
|
72
|
+
cjs: "application/node",
|
|
73
|
+
class: "application/java-vm",
|
|
74
|
+
coffee: "text/coffeescript",
|
|
75
|
+
conf: "text/plain",
|
|
76
|
+
cpl: "application/cpl+xml",
|
|
77
|
+
cpt: "application/mac-compactpro",
|
|
78
|
+
crl: "application/pkix-crl",
|
|
79
|
+
css: "text/css",
|
|
80
|
+
csv: "text/csv",
|
|
81
|
+
cu: "application/cu-seeme",
|
|
82
|
+
cwl: "application/cwl",
|
|
83
|
+
cww: "application/prs.cww",
|
|
84
|
+
davmount: "application/davmount+xml",
|
|
85
|
+
dbk: "application/docbook+xml",
|
|
86
|
+
deb: "application/octet-stream",
|
|
87
|
+
def: "text/plain",
|
|
88
|
+
deploy: "application/octet-stream",
|
|
89
|
+
dib: "image/bmp",
|
|
90
|
+
"disposition-notification": "message/disposition-notification",
|
|
91
|
+
dist: "application/octet-stream",
|
|
92
|
+
distz: "application/octet-stream",
|
|
93
|
+
dll: "application/octet-stream",
|
|
94
|
+
dmg: "application/octet-stream",
|
|
95
|
+
dms: "application/octet-stream",
|
|
96
|
+
doc: "application/msword",
|
|
97
|
+
dot: "application/msword",
|
|
98
|
+
dpx: "image/dpx",
|
|
99
|
+
drle: "image/dicom-rle",
|
|
100
|
+
dsc: "text/prs.lines.tag",
|
|
101
|
+
dssc: "application/dssc+der",
|
|
102
|
+
dtd: "application/xml-dtd",
|
|
103
|
+
dump: "application/octet-stream",
|
|
104
|
+
dwd: "application/atsc-dwd+xml",
|
|
105
|
+
ear: "application/java-archive",
|
|
106
|
+
ecma: "application/ecmascript",
|
|
107
|
+
elc: "application/octet-stream",
|
|
108
|
+
emf: "image/emf",
|
|
109
|
+
eml: "message/rfc822",
|
|
110
|
+
emma: "application/emma+xml",
|
|
111
|
+
emotionml: "application/emotionml+xml",
|
|
112
|
+
eps: "application/postscript",
|
|
113
|
+
epub: "application/epub+zip",
|
|
114
|
+
exe: "application/octet-stream",
|
|
115
|
+
exi: "application/exi",
|
|
116
|
+
exp: "application/express",
|
|
117
|
+
exr: "image/aces",
|
|
118
|
+
ez: "application/andrew-inset",
|
|
119
|
+
fdf: "application/fdf",
|
|
120
|
+
fdt: "application/fdt+xml",
|
|
121
|
+
fits: "image/fits",
|
|
122
|
+
g3: "image/g3fax",
|
|
123
|
+
gbr: "application/rpki-ghostbusters",
|
|
124
|
+
geojson: "application/geo+json",
|
|
125
|
+
gif: "image/gif",
|
|
126
|
+
glb: "model/gltf-binary",
|
|
127
|
+
gltf: "model/gltf+json",
|
|
128
|
+
gml: "application/gml+xml",
|
|
129
|
+
gpx: "application/gpx+xml",
|
|
130
|
+
gram: "application/srgs",
|
|
131
|
+
grxml: "application/srgs+xml",
|
|
132
|
+
gxf: "application/gxf",
|
|
133
|
+
gz: "application/gzip",
|
|
134
|
+
h261: "video/h261",
|
|
135
|
+
h263: "video/h263",
|
|
136
|
+
h264: "video/h264",
|
|
137
|
+
heic: "image/heic",
|
|
138
|
+
heics: "image/heic-sequence",
|
|
139
|
+
heif: "image/heif",
|
|
140
|
+
heifs: "image/heif-sequence",
|
|
141
|
+
hej2: "image/hej2k",
|
|
142
|
+
held: "application/atsc-held+xml",
|
|
143
|
+
hjson: "application/hjson",
|
|
144
|
+
hlp: "application/winhlp",
|
|
145
|
+
hqx: "application/mac-binhex40",
|
|
146
|
+
hsj2: "image/hsj2",
|
|
147
|
+
htm: "text/html",
|
|
148
|
+
html: "text/html",
|
|
149
|
+
ics: "text/calendar",
|
|
150
|
+
ief: "image/ief",
|
|
151
|
+
ifb: "text/calendar",
|
|
152
|
+
iges: "model/iges",
|
|
153
|
+
igs: "model/iges",
|
|
154
|
+
img: "application/octet-stream",
|
|
155
|
+
in: "text/plain",
|
|
156
|
+
ini: "text/plain",
|
|
157
|
+
ink: "application/inkml+xml",
|
|
158
|
+
inkml: "application/inkml+xml",
|
|
159
|
+
ipfix: "application/ipfix",
|
|
160
|
+
iso: "application/octet-stream",
|
|
161
|
+
its: "application/its+xml",
|
|
162
|
+
jade: "text/jade",
|
|
163
|
+
jar: "application/java-archive",
|
|
164
|
+
jhc: "image/jphc",
|
|
165
|
+
jls: "image/jls",
|
|
166
|
+
jp2: "image/jp2",
|
|
167
|
+
jpe: "image/jpeg",
|
|
168
|
+
jpeg: "image/jpeg",
|
|
169
|
+
jpf: "image/jpx",
|
|
170
|
+
jpg: "image/jpeg",
|
|
171
|
+
jpg2: "image/jp2",
|
|
172
|
+
jpgm: "image/jpm",
|
|
173
|
+
jpgv: "video/jpeg",
|
|
174
|
+
jph: "image/jph",
|
|
175
|
+
jpm: "image/jpm",
|
|
176
|
+
jpx: "image/jpx",
|
|
177
|
+
js: "text/javascript",
|
|
178
|
+
json: "application/json",
|
|
179
|
+
json5: "application/json5",
|
|
180
|
+
jsonld: "application/ld+json",
|
|
181
|
+
jsonml: "application/jsonml+json",
|
|
182
|
+
jsx: "text/jsx",
|
|
183
|
+
jt: "model/jt",
|
|
184
|
+
jxr: "image/jxr",
|
|
185
|
+
jxra: "image/jxra",
|
|
186
|
+
jxrs: "image/jxrs",
|
|
187
|
+
jxs: "image/jxs",
|
|
188
|
+
jxsc: "image/jxsc",
|
|
189
|
+
jxsi: "image/jxsi",
|
|
190
|
+
jxss: "image/jxss",
|
|
191
|
+
kar: "audio/midi",
|
|
192
|
+
ktx: "image/ktx",
|
|
193
|
+
ktx2: "image/ktx2",
|
|
194
|
+
less: "text/less",
|
|
195
|
+
lgr: "application/lgr+xml",
|
|
196
|
+
list: "text/plain",
|
|
197
|
+
litcoffee: "text/coffeescript",
|
|
198
|
+
log: "text/plain",
|
|
199
|
+
lostxml: "application/lost+xml",
|
|
200
|
+
lrf: "application/octet-stream",
|
|
201
|
+
m1v: "video/mpeg",
|
|
202
|
+
m21: "application/mp21",
|
|
203
|
+
m2a: "audio/mpeg",
|
|
204
|
+
m2v: "video/mpeg",
|
|
205
|
+
m3a: "audio/mpeg",
|
|
206
|
+
m4a: "audio/mp4",
|
|
207
|
+
m4p: "application/mp4",
|
|
208
|
+
m4s: "video/iso.segment",
|
|
209
|
+
ma: "application/mathematica",
|
|
210
|
+
mads: "application/mads+xml",
|
|
211
|
+
maei: "application/mmt-aei+xml",
|
|
212
|
+
man: "text/troff",
|
|
213
|
+
manifest: "text/cache-manifest",
|
|
214
|
+
map: "application/json",
|
|
215
|
+
mar: "application/octet-stream",
|
|
216
|
+
markdown: "text/markdown",
|
|
217
|
+
mathml: "application/mathml+xml",
|
|
218
|
+
mb: "application/mathematica",
|
|
219
|
+
mbox: "application/mbox",
|
|
220
|
+
md: "text/markdown",
|
|
221
|
+
mdx: "text/mdx",
|
|
222
|
+
me: "text/troff",
|
|
223
|
+
mesh: "model/mesh",
|
|
224
|
+
meta4: "application/metalink4+xml",
|
|
225
|
+
metalink: "application/metalink+xml",
|
|
226
|
+
mets: "application/mets+xml",
|
|
227
|
+
mft: "application/rpki-manifest",
|
|
228
|
+
mid: "audio/midi",
|
|
229
|
+
midi: "audio/midi",
|
|
230
|
+
mime: "message/rfc822",
|
|
231
|
+
mj2: "video/mj2",
|
|
232
|
+
mjp2: "video/mj2",
|
|
233
|
+
mjs: "text/javascript",
|
|
234
|
+
mml: "text/mathml",
|
|
235
|
+
mods: "application/mods+xml",
|
|
236
|
+
mov: "video/quicktime",
|
|
237
|
+
mp2: "audio/mpeg",
|
|
238
|
+
mp21: "application/mp21",
|
|
239
|
+
mp2a: "audio/mpeg",
|
|
240
|
+
mp3: "audio/mpeg",
|
|
241
|
+
mp4: "video/mp4",
|
|
242
|
+
mp4a: "audio/mp4",
|
|
243
|
+
mp4s: "application/mp4",
|
|
244
|
+
mp4v: "video/mp4",
|
|
245
|
+
mpd: "application/dash+xml",
|
|
246
|
+
mpe: "video/mpeg",
|
|
247
|
+
mpeg: "video/mpeg",
|
|
248
|
+
mpf: "application/media-policy-dataset+xml",
|
|
249
|
+
mpg: "video/mpeg",
|
|
250
|
+
mpg4: "video/mp4",
|
|
251
|
+
mpga: "audio/mpeg",
|
|
252
|
+
mpp: "application/dash-patch+xml",
|
|
253
|
+
mrc: "application/marc",
|
|
254
|
+
mrcx: "application/marcxml+xml",
|
|
255
|
+
ms: "text/troff",
|
|
256
|
+
mscml: "application/mediaservercontrol+xml",
|
|
257
|
+
msh: "model/mesh",
|
|
258
|
+
msi: "application/octet-stream",
|
|
259
|
+
msix: "application/msix",
|
|
260
|
+
msixbundle: "application/msixbundle",
|
|
261
|
+
msm: "application/octet-stream",
|
|
262
|
+
msp: "application/octet-stream",
|
|
263
|
+
mtl: "model/mtl",
|
|
264
|
+
musd: "application/mmt-usd+xml",
|
|
265
|
+
mxf: "application/mxf",
|
|
266
|
+
mxmf: "audio/mobile-xmf",
|
|
267
|
+
mxml: "application/xv+xml",
|
|
268
|
+
n3: "text/n3",
|
|
269
|
+
nb: "application/mathematica",
|
|
270
|
+
nq: "application/n-quads",
|
|
271
|
+
nt: "application/n-triples",
|
|
272
|
+
obj: "model/obj",
|
|
273
|
+
oda: "application/oda",
|
|
274
|
+
oga: "audio/ogg",
|
|
275
|
+
ogg: "audio/ogg",
|
|
276
|
+
ogv: "video/ogg",
|
|
277
|
+
ogx: "application/ogg",
|
|
278
|
+
omdoc: "application/omdoc+xml",
|
|
279
|
+
onepkg: "application/onenote",
|
|
280
|
+
onetmp: "application/onenote",
|
|
281
|
+
onetoc: "application/onenote",
|
|
282
|
+
onetoc2: "application/onenote",
|
|
283
|
+
opf: "application/oebps-package+xml",
|
|
284
|
+
opus: "audio/ogg",
|
|
285
|
+
otf: "font/otf",
|
|
286
|
+
owl: "application/rdf+xml",
|
|
287
|
+
oxps: "application/oxps",
|
|
288
|
+
p10: "application/pkcs10",
|
|
289
|
+
p7c: "application/pkcs7-mime",
|
|
290
|
+
p7m: "application/pkcs7-mime",
|
|
291
|
+
p7s: "application/pkcs7-signature",
|
|
292
|
+
p8: "application/pkcs8",
|
|
293
|
+
pdf: "application/pdf",
|
|
294
|
+
pfr: "application/font-tdpfr",
|
|
295
|
+
pgp: "application/pgp-encrypted",
|
|
296
|
+
pkg: "application/octet-stream",
|
|
297
|
+
pki: "application/pkixcmp",
|
|
298
|
+
pkipath: "application/pkix-pkipath",
|
|
299
|
+
pls: "application/pls+xml",
|
|
300
|
+
png: "image/png",
|
|
301
|
+
prc: "model/prc",
|
|
302
|
+
prf: "application/pics-rules",
|
|
303
|
+
provx: "application/provenance+xml",
|
|
304
|
+
ps: "application/postscript",
|
|
305
|
+
pskcxml: "application/pskc+xml",
|
|
306
|
+
pti: "image/prs.pti",
|
|
307
|
+
qt: "video/quicktime",
|
|
308
|
+
raml: "application/raml+yaml",
|
|
309
|
+
rapd: "application/route-apd+xml",
|
|
310
|
+
rdf: "application/rdf+xml",
|
|
311
|
+
relo: "application/p2p-overlay+xml",
|
|
312
|
+
rif: "application/reginfo+xml",
|
|
313
|
+
rl: "application/resource-lists+xml",
|
|
314
|
+
rld: "application/resource-lists-diff+xml",
|
|
315
|
+
rmi: "audio/midi",
|
|
316
|
+
rnc: "application/relax-ng-compact-syntax",
|
|
317
|
+
rng: "application/xml",
|
|
318
|
+
roa: "application/rpki-roa",
|
|
319
|
+
roff: "text/troff",
|
|
320
|
+
rq: "application/sparql-query",
|
|
321
|
+
rs: "application/rls-services+xml",
|
|
322
|
+
rsat: "application/atsc-rsat+xml",
|
|
323
|
+
rsd: "application/rsd+xml",
|
|
324
|
+
rsheet: "application/urc-ressheet+xml",
|
|
325
|
+
rss: "application/rss+xml",
|
|
326
|
+
rtf: "text/rtf",
|
|
327
|
+
rtx: "text/richtext",
|
|
328
|
+
rusd: "application/route-usd+xml",
|
|
329
|
+
s3m: "audio/s3m",
|
|
330
|
+
sbml: "application/sbml+xml",
|
|
331
|
+
scq: "application/scvp-cv-request",
|
|
332
|
+
scs: "application/scvp-cv-response",
|
|
333
|
+
sdp: "application/sdp",
|
|
334
|
+
senmlx: "application/senml+xml",
|
|
335
|
+
sensmlx: "application/sensml+xml",
|
|
336
|
+
ser: "application/java-serialized-object",
|
|
337
|
+
setpay: "application/set-payment-initiation",
|
|
338
|
+
setreg: "application/set-registration-initiation",
|
|
339
|
+
sgi: "image/sgi",
|
|
340
|
+
sgm: "text/sgml",
|
|
341
|
+
sgml: "text/sgml",
|
|
342
|
+
shex: "text/shex",
|
|
343
|
+
shf: "application/shf+xml",
|
|
344
|
+
shtml: "text/html",
|
|
345
|
+
sieve: "application/sieve",
|
|
346
|
+
sig: "application/pgp-signature",
|
|
347
|
+
sil: "audio/silk",
|
|
348
|
+
silo: "model/mesh",
|
|
349
|
+
siv: "application/sieve",
|
|
350
|
+
slim: "text/slim",
|
|
351
|
+
slm: "text/slim",
|
|
352
|
+
sls: "application/route-s-tsid+xml",
|
|
353
|
+
smi: "application/smil+xml",
|
|
354
|
+
smil: "application/smil+xml",
|
|
355
|
+
snd: "audio/basic",
|
|
356
|
+
so: "application/octet-stream",
|
|
357
|
+
spdx: "text/spdx",
|
|
358
|
+
spp: "application/scvp-vp-response",
|
|
359
|
+
spq: "application/scvp-vp-request",
|
|
360
|
+
spx: "audio/ogg",
|
|
361
|
+
sql: "application/sql",
|
|
362
|
+
sru: "application/sru+xml",
|
|
363
|
+
srx: "application/sparql-results+xml",
|
|
364
|
+
ssdl: "application/ssdl+xml",
|
|
365
|
+
ssml: "application/ssml+xml",
|
|
366
|
+
stk: "application/hyperstudio",
|
|
367
|
+
stl: "model/stl",
|
|
368
|
+
stpx: "model/step+xml",
|
|
369
|
+
stpxz: "model/step-xml+zip",
|
|
370
|
+
stpz: "model/step+zip",
|
|
371
|
+
styl: "text/stylus",
|
|
372
|
+
stylus: "text/stylus",
|
|
373
|
+
svg: "image/svg+xml",
|
|
374
|
+
svgz: "image/svg+xml",
|
|
375
|
+
swidtag: "application/swid+xml",
|
|
376
|
+
t: "text/troff",
|
|
377
|
+
t38: "image/t38",
|
|
378
|
+
td: "application/urc-targetdesc+xml",
|
|
379
|
+
tei: "application/tei+xml",
|
|
380
|
+
teicorpus: "application/tei+xml",
|
|
381
|
+
text: "text/plain",
|
|
382
|
+
tfi: "application/thraud+xml",
|
|
383
|
+
tfx: "image/tiff-fx",
|
|
384
|
+
tif: "image/tiff",
|
|
385
|
+
tiff: "image/tiff",
|
|
386
|
+
toml: "application/toml",
|
|
387
|
+
tr: "text/troff",
|
|
388
|
+
trig: "application/trig",
|
|
389
|
+
ts: "video/mp2t",
|
|
390
|
+
tsd: "application/timestamped-data",
|
|
391
|
+
tsv: "text/tab-separated-values",
|
|
392
|
+
ttc: "font/collection",
|
|
393
|
+
ttf: "font/ttf",
|
|
394
|
+
ttl: "text/turtle",
|
|
395
|
+
ttml: "application/ttml+xml",
|
|
396
|
+
txt: "text/plain",
|
|
397
|
+
u3d: "model/u3d",
|
|
398
|
+
u8dsn: "message/global-delivery-status",
|
|
399
|
+
u8hdr: "message/global-headers",
|
|
400
|
+
u8mdn: "message/global-disposition-notification",
|
|
401
|
+
u8msg: "message/global",
|
|
402
|
+
ubj: "application/ubjson",
|
|
403
|
+
uri: "text/uri-list",
|
|
404
|
+
uris: "text/uri-list",
|
|
405
|
+
urls: "text/uri-list",
|
|
406
|
+
vcard: "text/vcard",
|
|
407
|
+
vrml: "model/vrml",
|
|
408
|
+
vtt: "text/vtt",
|
|
409
|
+
vxml: "application/voicexml+xml",
|
|
410
|
+
war: "application/java-archive",
|
|
411
|
+
wasm: "application/wasm",
|
|
412
|
+
wav: "audio/wav",
|
|
413
|
+
weba: "audio/webm",
|
|
414
|
+
webm: "video/webm",
|
|
415
|
+
webmanifest: "application/manifest+json",
|
|
416
|
+
webp: "image/webp",
|
|
417
|
+
wgsl: "text/wgsl",
|
|
418
|
+
wgt: "application/widget",
|
|
419
|
+
wif: "application/watcherinfo+xml",
|
|
420
|
+
wmf: "image/wmf",
|
|
421
|
+
woff: "font/woff",
|
|
422
|
+
woff2: "font/woff2",
|
|
423
|
+
wrl: "model/vrml",
|
|
424
|
+
wsdl: "application/wsdl+xml",
|
|
425
|
+
wspolicy: "application/wspolicy+xml",
|
|
426
|
+
x3d: "model/x3d+xml",
|
|
427
|
+
x3db: "model/x3d+fastinfoset",
|
|
428
|
+
x3dbz: "model/x3d+binary",
|
|
429
|
+
x3dv: "model/x3d-vrml",
|
|
430
|
+
x3dvz: "model/x3d+vrml",
|
|
431
|
+
x3dz: "model/x3d+xml",
|
|
432
|
+
xaml: "application/xaml+xml",
|
|
433
|
+
xav: "application/xcap-att+xml",
|
|
434
|
+
xca: "application/xcap-caps+xml",
|
|
435
|
+
xcs: "application/calendar+xml",
|
|
436
|
+
xdf: "application/xcap-diff+xml",
|
|
437
|
+
xdssc: "application/dssc+xml",
|
|
438
|
+
xel: "application/xcap-el+xml",
|
|
439
|
+
xenc: "application/xenc+xml",
|
|
440
|
+
xer: "application/patch-ops-error+xml",
|
|
441
|
+
xfdf: "application/xfdf",
|
|
442
|
+
xht: "application/xhtml+xml",
|
|
443
|
+
xhtml: "application/xhtml+xml",
|
|
444
|
+
xhvml: "application/xv+xml",
|
|
445
|
+
xlf: "application/xliff+xml",
|
|
446
|
+
xm: "audio/xm",
|
|
447
|
+
xml: "text/xml",
|
|
448
|
+
xns: "application/xcap-ns+xml",
|
|
449
|
+
xop: "application/xop+xml",
|
|
450
|
+
xpl: "application/xproc+xml",
|
|
451
|
+
xsd: "application/xml",
|
|
452
|
+
xsf: "application/prs.xsf+xml",
|
|
453
|
+
xsl: "application/xml",
|
|
454
|
+
xslt: "application/xml",
|
|
455
|
+
xspf: "application/xspf+xml",
|
|
456
|
+
xvm: "application/xv+xml",
|
|
457
|
+
xvml: "application/xv+xml",
|
|
458
|
+
yaml: "text/yaml",
|
|
459
|
+
yang: "application/yang",
|
|
460
|
+
yin: "application/yin+xml",
|
|
461
|
+
yml: "text/yaml",
|
|
462
|
+
zip: "application/zip",
|
|
463
|
+
};
|
|
464
|
+
function lookup(extn) {
|
|
465
|
+
let tmp = ("" + extn).trim().toLowerCase();
|
|
466
|
+
let idx = tmp.lastIndexOf(".");
|
|
467
|
+
return mimes[!~idx ? tmp : tmp.substring(++idx)];
|
|
468
|
+
}
|
|
469
|
+
exports.mimes = mimes;
|
|
470
|
+
exports.lookup = lookup;
|
|
471
|
+
},
|
|
472
|
+
761: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
473
|
+
const fs = __nccwpck_require__(561);
|
|
474
|
+
const { join, normalize, resolve } = __nccwpck_require__(411);
|
|
475
|
+
const { totalist } = __nccwpck_require__(190);
|
|
476
|
+
const { parse } = __nccwpck_require__(472);
|
|
477
|
+
const { lookup } = __nccwpck_require__(486);
|
|
478
|
+
const noop = () => {};
|
|
479
|
+
function isMatch(uri, arr) {
|
|
480
|
+
for (let i = 0; i < arr.length; i++) {
|
|
481
|
+
if (arr[i].test(uri)) return true;
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
function toAssume(uri, extns) {
|
|
485
|
+
let i = 0,
|
|
486
|
+
x,
|
|
487
|
+
len = uri.length - 1;
|
|
488
|
+
if (uri.charCodeAt(len) === 47) {
|
|
489
|
+
uri = uri.substring(0, len);
|
|
490
|
+
}
|
|
491
|
+
let arr = [],
|
|
492
|
+
tmp = `${uri}/index`;
|
|
493
|
+
for (; i < extns.length; i++) {
|
|
494
|
+
x = extns[i] ? `.${extns[i]}` : "";
|
|
495
|
+
if (uri) arr.push(uri + x);
|
|
496
|
+
arr.push(tmp + x);
|
|
497
|
+
}
|
|
498
|
+
return arr;
|
|
499
|
+
}
|
|
500
|
+
function viaCache(cache, uri, extns) {
|
|
501
|
+
let i = 0,
|
|
502
|
+
data,
|
|
503
|
+
arr = toAssume(uri, extns);
|
|
504
|
+
for (; i < arr.length; i++) {
|
|
505
|
+
if ((data = cache[arr[i]])) return data;
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
function viaLocal(dir, isEtag, uri, extns) {
|
|
509
|
+
let i = 0,
|
|
510
|
+
arr = toAssume(uri, extns);
|
|
511
|
+
let abs, stats, name, headers;
|
|
512
|
+
for (; i < arr.length; i++) {
|
|
513
|
+
abs = normalize(join(dir, (name = arr[i])));
|
|
514
|
+
if (abs.startsWith(dir) && fs.existsSync(abs)) {
|
|
515
|
+
stats = fs.statSync(abs);
|
|
516
|
+
if (stats.isDirectory()) continue;
|
|
517
|
+
headers = toHeaders(name, stats, isEtag);
|
|
518
|
+
headers["Cache-Control"] = isEtag ? "no-cache" : "no-store";
|
|
519
|
+
return { abs, stats, headers };
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
function is404(req, res) {
|
|
524
|
+
return (res.statusCode = 404), res.end();
|
|
525
|
+
}
|
|
526
|
+
function send(req, res, file, stats, headers) {
|
|
527
|
+
let code = 200,
|
|
528
|
+
tmp,
|
|
529
|
+
opts = {};
|
|
530
|
+
headers = { ...headers };
|
|
531
|
+
for (let key in headers) {
|
|
532
|
+
tmp = res.getHeader(key);
|
|
533
|
+
if (tmp) headers[key] = tmp;
|
|
534
|
+
}
|
|
535
|
+
if ((tmp = res.getHeader("content-type"))) {
|
|
536
|
+
headers["Content-Type"] = tmp;
|
|
537
|
+
}
|
|
538
|
+
if (req.headers.range) {
|
|
539
|
+
code = 206;
|
|
540
|
+
let [x, y] = req.headers.range.replace("bytes=", "").split("-");
|
|
541
|
+
let end = (opts.end = parseInt(y, 10) || stats.size - 1);
|
|
542
|
+
let start = (opts.start = parseInt(x, 10) || 0);
|
|
543
|
+
if (end >= stats.size) {
|
|
544
|
+
end = stats.size - 1;
|
|
545
|
+
}
|
|
546
|
+
if (start >= stats.size) {
|
|
547
|
+
res.setHeader("Content-Range", `bytes */${stats.size}`);
|
|
548
|
+
res.statusCode = 416;
|
|
549
|
+
return res.end();
|
|
550
|
+
}
|
|
551
|
+
headers["Content-Range"] = `bytes ${start}-${end}/${stats.size}`;
|
|
552
|
+
headers["Content-Length"] = end - start + 1;
|
|
553
|
+
headers["Accept-Ranges"] = "bytes";
|
|
554
|
+
}
|
|
555
|
+
res.writeHead(code, headers);
|
|
556
|
+
fs.createReadStream(file, opts).pipe(res);
|
|
557
|
+
}
|
|
558
|
+
const ENCODING = { ".br": "br", ".gz": "gzip" };
|
|
559
|
+
function toHeaders(name, stats, isEtag) {
|
|
560
|
+
let enc = ENCODING[name.slice(-3)];
|
|
561
|
+
let ctype = lookup(name.slice(0, enc && -3)) || "";
|
|
562
|
+
if (ctype === "text/html") ctype += ";charset=utf-8";
|
|
563
|
+
let headers = {
|
|
564
|
+
"Content-Length": stats.size,
|
|
565
|
+
"Content-Type": ctype,
|
|
566
|
+
"Last-Modified": stats.mtime.toUTCString(),
|
|
567
|
+
};
|
|
568
|
+
if (enc) headers["Content-Encoding"] = enc;
|
|
569
|
+
if (isEtag)
|
|
570
|
+
headers["ETag"] = `W/"${stats.size}-${stats.mtime.getTime()}"`;
|
|
571
|
+
return headers;
|
|
572
|
+
}
|
|
573
|
+
module.exports = function (dir, opts = {}) {
|
|
574
|
+
dir = resolve(dir || ".");
|
|
575
|
+
let isNotFound = opts.onNoMatch || is404;
|
|
576
|
+
let setHeaders = opts.setHeaders || noop;
|
|
577
|
+
let extensions = opts.extensions || ["html", "htm"];
|
|
578
|
+
let gzips = opts.gzip && extensions.map((x) => `${x}.gz`).concat("gz");
|
|
579
|
+
let brots =
|
|
580
|
+
opts.brotli && extensions.map((x) => `${x}.br`).concat("br");
|
|
581
|
+
const FILES = {};
|
|
582
|
+
let fallback = "/";
|
|
583
|
+
let isEtag = !!opts.etag;
|
|
584
|
+
let isSPA = !!opts.single;
|
|
585
|
+
if (typeof opts.single === "string") {
|
|
586
|
+
let idx = opts.single.lastIndexOf(".");
|
|
587
|
+
fallback += !!~idx ? opts.single.substring(0, idx) : opts.single;
|
|
588
|
+
}
|
|
589
|
+
let ignores = [];
|
|
590
|
+
if (opts.ignores !== false) {
|
|
591
|
+
ignores.push(/[/]([A-Za-z\s\d~$._-]+\.\w+){1,}$/);
|
|
592
|
+
if (opts.dotfiles) ignores.push(/\/\.\w/);
|
|
593
|
+
else ignores.push(/\/\.well-known/);
|
|
594
|
+
[].concat(opts.ignores || []).forEach((x) => {
|
|
595
|
+
ignores.push(new RegExp(x, "i"));
|
|
596
|
+
});
|
|
597
|
+
}
|
|
598
|
+
let cc = opts.maxAge != null && `public,max-age=${opts.maxAge}`;
|
|
599
|
+
if (cc && opts.immutable) cc += ",immutable";
|
|
600
|
+
else if (cc && opts.maxAge === 0) cc += ",must-revalidate";
|
|
601
|
+
if (!opts.dev) {
|
|
602
|
+
totalist(dir, (name, abs, stats) => {
|
|
603
|
+
if (/\.well-known[\\+\/]/.test(name)) {
|
|
604
|
+
} else if (!opts.dotfiles && /(^\.|[\\+|\/+]\.)/.test(name)) return;
|
|
605
|
+
let headers = toHeaders(name, stats, isEtag);
|
|
606
|
+
if (cc) headers["Cache-Control"] = cc;
|
|
607
|
+
FILES["/" + name.normalize().replace(/\\+/g, "/")] = {
|
|
608
|
+
abs,
|
|
609
|
+
stats,
|
|
610
|
+
headers,
|
|
611
|
+
};
|
|
612
|
+
});
|
|
613
|
+
}
|
|
614
|
+
let lookup = opts.dev
|
|
615
|
+
? viaLocal.bind(0, dir, isEtag)
|
|
616
|
+
: viaCache.bind(0, FILES);
|
|
617
|
+
return function (req, res, next) {
|
|
618
|
+
let extns = [""];
|
|
619
|
+
let pathname = parse(req).pathname;
|
|
620
|
+
let val = req.headers["accept-encoding"] || "";
|
|
621
|
+
if (gzips && val.includes("gzip")) extns.unshift(...gzips);
|
|
622
|
+
if (brots && /(br|brotli)/i.test(val)) extns.unshift(...brots);
|
|
623
|
+
extns.push(...extensions);
|
|
624
|
+
if (pathname.indexOf("%") !== -1) {
|
|
625
|
+
try {
|
|
626
|
+
pathname = decodeURI(pathname);
|
|
627
|
+
} catch (err) {}
|
|
628
|
+
}
|
|
629
|
+
let data =
|
|
630
|
+
lookup(pathname, extns) ||
|
|
631
|
+
(isSPA && !isMatch(pathname, ignores) && lookup(fallback, extns));
|
|
632
|
+
if (!data) return next ? next() : isNotFound(req, res);
|
|
633
|
+
if (isEtag && req.headers["if-none-match"] === data.headers["ETag"]) {
|
|
634
|
+
res.writeHead(304);
|
|
635
|
+
return res.end();
|
|
636
|
+
}
|
|
637
|
+
if (gzips || brots) {
|
|
638
|
+
res.setHeader("Vary", "Accept-Encoding");
|
|
639
|
+
}
|
|
640
|
+
setHeaders(res, pathname, data.stats);
|
|
641
|
+
send(req, res, data.abs, data.stats, data.headers);
|
|
642
|
+
};
|
|
643
|
+
};
|
|
644
|
+
},
|
|
645
|
+
190: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
646
|
+
const { join, resolve } = __nccwpck_require__(17);
|
|
647
|
+
const { readdirSync, statSync } = __nccwpck_require__(147);
|
|
648
|
+
function totalist(dir, callback, pre = "") {
|
|
649
|
+
dir = resolve(".", dir);
|
|
650
|
+
let arr = readdirSync(dir);
|
|
651
|
+
let i = 0,
|
|
652
|
+
abs,
|
|
653
|
+
stats;
|
|
654
|
+
for (; i < arr.length; i++) {
|
|
655
|
+
abs = join(dir, arr[i]);
|
|
656
|
+
stats = statSync(abs);
|
|
657
|
+
stats.isDirectory()
|
|
658
|
+
? totalist(abs, callback, join(pre, arr[i]))
|
|
659
|
+
: callback(join(pre, arr[i]), abs, stats);
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
exports.totalist = totalist;
|
|
663
|
+
},
|
|
664
|
+
147: (module) => {
|
|
665
|
+
"use strict";
|
|
666
|
+
module.exports = require("fs");
|
|
667
|
+
},
|
|
668
|
+
561: (module) => {
|
|
669
|
+
"use strict";
|
|
670
|
+
module.exports = require("node:fs");
|
|
671
|
+
},
|
|
672
|
+
411: (module) => {
|
|
673
|
+
"use strict";
|
|
674
|
+
module.exports = require("node:path");
|
|
675
|
+
},
|
|
676
|
+
17: (module) => {
|
|
677
|
+
"use strict";
|
|
678
|
+
module.exports = require("path");
|
|
679
|
+
},
|
|
680
|
+
477: (module) => {
|
|
681
|
+
"use strict";
|
|
682
|
+
module.exports = require("querystring");
|
|
683
|
+
},
|
|
684
|
+
};
|
|
685
|
+
var __webpack_module_cache__ = {};
|
|
686
|
+
function __nccwpck_require__(moduleId) {
|
|
687
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
688
|
+
if (cachedModule !== undefined) {
|
|
689
|
+
return cachedModule.exports;
|
|
690
|
+
}
|
|
691
|
+
var module = (__webpack_module_cache__[moduleId] = { exports: {} });
|
|
692
|
+
var threw = true;
|
|
693
|
+
try {
|
|
694
|
+
__webpack_modules__[moduleId](
|
|
695
|
+
module,
|
|
696
|
+
module.exports,
|
|
697
|
+
__nccwpck_require__,
|
|
698
|
+
);
|
|
699
|
+
threw = false;
|
|
700
|
+
} finally {
|
|
701
|
+
if (threw) delete __webpack_module_cache__[moduleId];
|
|
702
|
+
}
|
|
703
|
+
return module.exports;
|
|
704
|
+
}
|
|
705
|
+
if (typeof __nccwpck_require__ !== "undefined")
|
|
706
|
+
__nccwpck_require__.ab = __dirname + "/";
|
|
707
|
+
var __webpack_exports__ = __nccwpck_require__(761);
|
|
708
|
+
module.exports = __webpack_exports__;
|
|
709
|
+
})();
|