@rsbuild/core 1.7.2 → 2.0.0-alpha.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.
Files changed (123) hide show
  1. package/compiled/css-loader/index.js +2 -2
  2. package/compiled/html-rspack-plugin/index.js +14 -14
  3. package/compiled/http-proxy-middleware/index.d.ts +2 -2
  4. package/compiled/postcss/index.js +1 -1
  5. package/compiled/postcss-loader/index.js +6 -6
  6. package/compiled/rspack-chain/package.json +1 -1
  7. package/compiled/rspack-chain/types/index.d.ts +8 -59
  8. package/compiled/ws/index.js +59 -54
  9. package/compiled/ws/package.json +1 -1
  10. package/dist/131.js +1122 -1241
  11. package/dist/31.js +336 -0
  12. package/dist/710.js +445 -0
  13. package/dist/743.js +7 -0
  14. package/dist/{136.mjs → 88.js} +11 -13
  15. package/dist/client/hmr.js +0 -1
  16. package/dist/client/overlay.js +32 -21
  17. package/dist/connect.js +581 -0
  18. package/dist/connect.js.LICENSE.txt +54 -0
  19. package/dist/cors.js +188 -0
  20. package/dist/cors.js.LICENSE.txt +11 -0
  21. package/dist/launch-editor-middleware.js +439 -0
  22. package/dist/manifest-plugin.js +172 -0
  23. package/dist/memfs.js +3644 -0
  24. package/dist/{0~open.js → open.js} +21 -13
  25. package/dist/{0~range-parser.js → range-parser.js} +1 -1
  26. package/dist/remapping.js +196 -0
  27. package/dist/sirv.js +122 -0
  28. package/dist/tinyglobby.js +1463 -0
  29. package/dist/transformLoader.mjs +1 -1
  30. package/dist/transformRawLoader.mjs +1 -1
  31. package/dist-types/{provider/build.d.ts → build.d.ts} +2 -2
  32. package/dist-types/cli/commands.d.ts +1 -1
  33. package/dist-types/configChain.d.ts +2 -11
  34. package/dist-types/constants.d.ts +2 -3
  35. package/dist-types/{provider/createCompiler.d.ts → createCompiler.d.ts} +1 -1
  36. package/dist-types/defaultConfig.d.ts +1 -1
  37. package/dist-types/helpers/index.d.ts +1 -1
  38. package/dist-types/helpers/url.d.ts +0 -1
  39. package/dist-types/helpers/vendors.d.ts +0 -13
  40. package/dist-types/hooks.d.ts +3 -5
  41. package/dist-types/index.d.ts +1 -1
  42. package/dist-types/{provider/initConfigs.d.ts → initConfigs.d.ts} +1 -1
  43. package/dist-types/inspectConfig.d.ts +5 -33
  44. package/dist-types/pluginHelper.d.ts +1 -1
  45. package/dist-types/plugins/css.d.ts +1 -1
  46. package/dist-types/plugins/inlineChunk.d.ts +1 -1
  47. package/dist-types/plugins/minimize.d.ts +2 -2
  48. package/dist-types/{provider/rspackConfig.d.ts → rspackConfig.d.ts} +1 -1
  49. package/dist-types/server/assets-middleware/setupOutputFileSystem.d.ts +1 -1
  50. package/dist-types/server/browserLogs.d.ts +1 -1
  51. package/dist-types/server/devMiddlewares.d.ts +1 -1
  52. package/dist-types/server/devServer.d.ts +1 -1
  53. package/dist-types/server/gzipMiddleware.d.ts +1 -1
  54. package/dist-types/server/helper.d.ts +3 -2
  55. package/dist-types/server/proxy.d.ts +1 -1
  56. package/dist-types/server/socketServer.d.ts +1 -1
  57. package/dist-types/types/config.d.ts +18 -70
  58. package/dist-types/types/context.d.ts +3 -2
  59. package/dist-types/types/hooks.d.ts +9 -9
  60. package/dist-types/types/plugin.d.ts +3 -40
  61. package/dist-types/types/rsbuild.d.ts +6 -31
  62. package/dist-types/types/rspack.d.ts +1 -7
  63. package/dist-types/types/thirdParty.d.ts +1 -4
  64. package/package.json +17 -22
  65. package/compiled/@jridgewell/remapping/index.d.ts +0 -1
  66. package/compiled/@jridgewell/remapping/index.js +0 -1222
  67. package/compiled/@jridgewell/remapping/license +0 -19
  68. package/compiled/@jridgewell/remapping/package.json +0 -1
  69. package/compiled/@jridgewell/trace-mapping/index.d.ts +0 -194
  70. package/compiled/@jridgewell/trace-mapping/index.js +0 -1408
  71. package/compiled/@jridgewell/trace-mapping/license +0 -19
  72. package/compiled/@jridgewell/trace-mapping/package.json +0 -1
  73. package/compiled/connect/index.d.ts +0 -90
  74. package/compiled/connect/index.js +0 -1240
  75. package/compiled/connect/license +0 -25
  76. package/compiled/connect/package.json +0 -1
  77. package/compiled/cors/index.d.ts +0 -56
  78. package/compiled/cors/index.js +0 -371
  79. package/compiled/cors/license +0 -22
  80. package/compiled/cors/package.json +0 -1
  81. package/compiled/launch-editor-middleware/index.d.ts +0 -1
  82. package/compiled/launch-editor-middleware/index.js +0 -719
  83. package/compiled/launch-editor-middleware/license +0 -21
  84. package/compiled/launch-editor-middleware/package.json +0 -1
  85. package/compiled/memfs/index.d.ts +0 -1462
  86. package/compiled/memfs/index.js +0 -1
  87. package/compiled/memfs/license +0 -201
  88. package/compiled/memfs/package.json +0 -1
  89. package/compiled/mrmime/index.d.ts +0 -4
  90. package/compiled/mrmime/index.js +0 -456
  91. package/compiled/mrmime/package.json +0 -1
  92. package/compiled/picocolors/index.d.ts +0 -55
  93. package/compiled/picocolors/index.js +0 -108
  94. package/compiled/picocolors/license +0 -15
  95. package/compiled/picocolors/package.json +0 -1
  96. package/compiled/rspack-manifest-plugin/index.d.ts +0 -48
  97. package/compiled/rspack-manifest-plugin/index.js +0 -409
  98. package/compiled/rspack-manifest-plugin/license +0 -21
  99. package/compiled/rspack-manifest-plugin/package.json +0 -1
  100. package/compiled/sirv/index.d.ts +0 -1
  101. package/compiled/sirv/index.js +0 -274
  102. package/compiled/sirv/package.json +0 -1
  103. package/compiled/tinyglobby/index.d.ts +0 -46
  104. package/compiled/tinyglobby/index.js +0 -2664
  105. package/compiled/tinyglobby/license +0 -21
  106. package/compiled/tinyglobby/package.json +0 -1
  107. package/compiled/webpack-bundle-analyzer/index.d.ts +0 -160
  108. package/compiled/webpack-bundle-analyzer/index.js +0 -23
  109. package/compiled/webpack-bundle-analyzer/license +0 -20
  110. package/compiled/webpack-bundle-analyzer/package.json +0 -1
  111. package/compiled/webpack-bundle-analyzer/public/viewer.js +0 -16
  112. package/compiled/webpack-bundle-analyzer/public/viewer.js.LICENSE.txt +0 -10
  113. package/dist/2~open.cjs +0 -436
  114. package/dist/2~range-parser.cjs +0 -52
  115. package/dist/2~range-parser.cjs.LICENSE.txt +0 -6
  116. package/dist/index.cjs +0 -9456
  117. package/dist/index.cjs.LICENSE.txt +0 -26
  118. package/dist-types/plugins/bundleAnalyzer.d.ts +0 -2
  119. package/dist-types/plugins/moment.d.ts +0 -2
  120. package/dist-types/plugins/performance.d.ts +0 -5
  121. package/dist-types/provider/helpers.d.ts +0 -12
  122. package/dist-types/provider/provider.d.ts +0 -2
  123. /package/dist/{0~range-parser.js.LICENSE.txt → range-parser.js.LICENSE.txt} +0 -0
package/dist/710.js ADDED
@@ -0,0 +1,445 @@
1
+ let mimes = {
2
+ "3g2": "video/3gpp2",
3
+ "3gp": "video/3gpp",
4
+ "3gpp": "video/3gpp",
5
+ "3mf": "model/3mf",
6
+ aac: "audio/aac",
7
+ ac: "application/pkix-attr-cert",
8
+ adp: "audio/adpcm",
9
+ adts: "audio/aac",
10
+ ai: "application/postscript",
11
+ aml: "application/automationml-aml+xml",
12
+ amlx: "application/automationml-amlx+zip",
13
+ amr: "audio/amr",
14
+ apng: "image/apng",
15
+ appcache: "text/cache-manifest",
16
+ appinstaller: "application/appinstaller",
17
+ appx: "application/appx",
18
+ appxbundle: "application/appxbundle",
19
+ asc: "application/pgp-keys",
20
+ atom: "application/atom+xml",
21
+ atomcat: "application/atomcat+xml",
22
+ atomdeleted: "application/atomdeleted+xml",
23
+ atomsvc: "application/atomsvc+xml",
24
+ au: "audio/basic",
25
+ avci: "image/avci",
26
+ avcs: "image/avcs",
27
+ avif: "image/avif",
28
+ aw: "application/applixware",
29
+ bdoc: "application/bdoc",
30
+ bin: "application/octet-stream",
31
+ bmp: "image/bmp",
32
+ bpk: "application/octet-stream",
33
+ btf: "image/prs.btif",
34
+ btif: "image/prs.btif",
35
+ buffer: "application/octet-stream",
36
+ ccxml: "application/ccxml+xml",
37
+ cdfx: "application/cdfx+xml",
38
+ cdmia: "application/cdmi-capability",
39
+ cdmic: "application/cdmi-container",
40
+ cdmid: "application/cdmi-domain",
41
+ cdmio: "application/cdmi-object",
42
+ cdmiq: "application/cdmi-queue",
43
+ cer: "application/pkix-cert",
44
+ cgm: "image/cgm",
45
+ cjs: "application/node",
46
+ class: "application/java-vm",
47
+ coffee: "text/coffeescript",
48
+ conf: "text/plain",
49
+ cpl: "application/cpl+xml",
50
+ cpt: "application/mac-compactpro",
51
+ crl: "application/pkix-crl",
52
+ css: "text/css",
53
+ csv: "text/csv",
54
+ cu: "application/cu-seeme",
55
+ cwl: "application/cwl",
56
+ cww: "application/prs.cww",
57
+ davmount: "application/davmount+xml",
58
+ dbk: "application/docbook+xml",
59
+ deb: "application/octet-stream",
60
+ def: "text/plain",
61
+ deploy: "application/octet-stream",
62
+ dib: "image/bmp",
63
+ "disposition-notification": "message/disposition-notification",
64
+ dist: "application/octet-stream",
65
+ distz: "application/octet-stream",
66
+ dll: "application/octet-stream",
67
+ dmg: "application/octet-stream",
68
+ dms: "application/octet-stream",
69
+ doc: "application/msword",
70
+ dot: "application/msword",
71
+ dpx: "image/dpx",
72
+ drle: "image/dicom-rle",
73
+ dsc: "text/prs.lines.tag",
74
+ dssc: "application/dssc+der",
75
+ dtd: "application/xml-dtd",
76
+ dump: "application/octet-stream",
77
+ dwd: "application/atsc-dwd+xml",
78
+ ear: "application/java-archive",
79
+ ecma: "application/ecmascript",
80
+ elc: "application/octet-stream",
81
+ emf: "image/emf",
82
+ eml: "message/rfc822",
83
+ emma: "application/emma+xml",
84
+ emotionml: "application/emotionml+xml",
85
+ eps: "application/postscript",
86
+ epub: "application/epub+zip",
87
+ exe: "application/octet-stream",
88
+ exi: "application/exi",
89
+ exp: "application/express",
90
+ exr: "image/aces",
91
+ ez: "application/andrew-inset",
92
+ fdf: "application/fdf",
93
+ fdt: "application/fdt+xml",
94
+ fits: "image/fits",
95
+ g3: "image/g3fax",
96
+ gbr: "application/rpki-ghostbusters",
97
+ geojson: "application/geo+json",
98
+ gif: "image/gif",
99
+ glb: "model/gltf-binary",
100
+ gltf: "model/gltf+json",
101
+ gml: "application/gml+xml",
102
+ gpx: "application/gpx+xml",
103
+ gram: "application/srgs",
104
+ grxml: "application/srgs+xml",
105
+ gxf: "application/gxf",
106
+ gz: "application/gzip",
107
+ h261: "video/h261",
108
+ h263: "video/h263",
109
+ h264: "video/h264",
110
+ heic: "image/heic",
111
+ heics: "image/heic-sequence",
112
+ heif: "image/heif",
113
+ heifs: "image/heif-sequence",
114
+ hej2: "image/hej2k",
115
+ held: "application/atsc-held+xml",
116
+ hjson: "application/hjson",
117
+ hlp: "application/winhlp",
118
+ hqx: "application/mac-binhex40",
119
+ hsj2: "image/hsj2",
120
+ htm: "text/html",
121
+ html: "text/html",
122
+ ics: "text/calendar",
123
+ ief: "image/ief",
124
+ ifb: "text/calendar",
125
+ iges: "model/iges",
126
+ igs: "model/iges",
127
+ img: "application/octet-stream",
128
+ in: "text/plain",
129
+ ini: "text/plain",
130
+ ink: "application/inkml+xml",
131
+ inkml: "application/inkml+xml",
132
+ ipfix: "application/ipfix",
133
+ iso: "application/octet-stream",
134
+ its: "application/its+xml",
135
+ jade: "text/jade",
136
+ jar: "application/java-archive",
137
+ jhc: "image/jphc",
138
+ jls: "image/jls",
139
+ jp2: "image/jp2",
140
+ jpe: "image/jpeg",
141
+ jpeg: "image/jpeg",
142
+ jpf: "image/jpx",
143
+ jpg: "image/jpeg",
144
+ jpg2: "image/jp2",
145
+ jpgm: "image/jpm",
146
+ jpgv: "video/jpeg",
147
+ jph: "image/jph",
148
+ jpm: "image/jpm",
149
+ jpx: "image/jpx",
150
+ js: "text/javascript",
151
+ json: "application/json",
152
+ json5: "application/json5",
153
+ jsonld: "application/ld+json",
154
+ jsonml: "application/jsonml+json",
155
+ jsx: "text/jsx",
156
+ jt: "model/jt",
157
+ jxl: "image/jxl",
158
+ jxr: "image/jxr",
159
+ jxra: "image/jxra",
160
+ jxrs: "image/jxrs",
161
+ jxs: "image/jxs",
162
+ jxsc: "image/jxsc",
163
+ jxsi: "image/jxsi",
164
+ jxss: "image/jxss",
165
+ kar: "audio/midi",
166
+ ktx: "image/ktx",
167
+ ktx2: "image/ktx2",
168
+ less: "text/less",
169
+ lgr: "application/lgr+xml",
170
+ list: "text/plain",
171
+ litcoffee: "text/coffeescript",
172
+ log: "text/plain",
173
+ lostxml: "application/lost+xml",
174
+ lrf: "application/octet-stream",
175
+ m1v: "video/mpeg",
176
+ m21: "application/mp21",
177
+ m2a: "audio/mpeg",
178
+ m2t: "video/mp2t",
179
+ m2ts: "video/mp2t",
180
+ m2v: "video/mpeg",
181
+ m3a: "audio/mpeg",
182
+ m4a: "audio/mp4",
183
+ m4p: "application/mp4",
184
+ m4s: "video/iso.segment",
185
+ ma: "application/mathematica",
186
+ mads: "application/mads+xml",
187
+ maei: "application/mmt-aei+xml",
188
+ man: "text/troff",
189
+ manifest: "text/cache-manifest",
190
+ map: "application/json",
191
+ mar: "application/octet-stream",
192
+ markdown: "text/markdown",
193
+ mathml: "application/mathml+xml",
194
+ mb: "application/mathematica",
195
+ mbox: "application/mbox",
196
+ md: "text/markdown",
197
+ mdx: "text/mdx",
198
+ me: "text/troff",
199
+ mesh: "model/mesh",
200
+ meta4: "application/metalink4+xml",
201
+ metalink: "application/metalink+xml",
202
+ mets: "application/mets+xml",
203
+ mft: "application/rpki-manifest",
204
+ mid: "audio/midi",
205
+ midi: "audio/midi",
206
+ mime: "message/rfc822",
207
+ mj2: "video/mj2",
208
+ mjp2: "video/mj2",
209
+ mjs: "text/javascript",
210
+ mml: "text/mathml",
211
+ mods: "application/mods+xml",
212
+ mov: "video/quicktime",
213
+ mp2: "audio/mpeg",
214
+ mp21: "application/mp21",
215
+ mp2a: "audio/mpeg",
216
+ mp3: "audio/mpeg",
217
+ mp4: "video/mp4",
218
+ mp4a: "audio/mp4",
219
+ mp4s: "application/mp4",
220
+ mp4v: "video/mp4",
221
+ mpd: "application/dash+xml",
222
+ mpe: "video/mpeg",
223
+ mpeg: "video/mpeg",
224
+ mpf: "application/media-policy-dataset+xml",
225
+ mpg: "video/mpeg",
226
+ mpg4: "video/mp4",
227
+ mpga: "audio/mpeg",
228
+ mpp: "application/dash-patch+xml",
229
+ mrc: "application/marc",
230
+ mrcx: "application/marcxml+xml",
231
+ ms: "text/troff",
232
+ mscml: "application/mediaservercontrol+xml",
233
+ msh: "model/mesh",
234
+ msi: "application/octet-stream",
235
+ msix: "application/msix",
236
+ msixbundle: "application/msixbundle",
237
+ msm: "application/octet-stream",
238
+ msp: "application/octet-stream",
239
+ mtl: "model/mtl",
240
+ mts: "video/mp2t",
241
+ musd: "application/mmt-usd+xml",
242
+ mxf: "application/mxf",
243
+ mxmf: "audio/mobile-xmf",
244
+ mxml: "application/xv+xml",
245
+ n3: "text/n3",
246
+ nb: "application/mathematica",
247
+ nq: "application/n-quads",
248
+ nt: "application/n-triples",
249
+ obj: "model/obj",
250
+ oda: "application/oda",
251
+ oga: "audio/ogg",
252
+ ogg: "audio/ogg",
253
+ ogv: "video/ogg",
254
+ ogx: "application/ogg",
255
+ omdoc: "application/omdoc+xml",
256
+ onepkg: "application/onenote",
257
+ onetmp: "application/onenote",
258
+ onetoc: "application/onenote",
259
+ onetoc2: "application/onenote",
260
+ opf: "application/oebps-package+xml",
261
+ opus: "audio/ogg",
262
+ otf: "font/otf",
263
+ owl: "application/rdf+xml",
264
+ oxps: "application/oxps",
265
+ p10: "application/pkcs10",
266
+ p7c: "application/pkcs7-mime",
267
+ p7m: "application/pkcs7-mime",
268
+ p7s: "application/pkcs7-signature",
269
+ p8: "application/pkcs8",
270
+ pdf: "application/pdf",
271
+ pfr: "application/font-tdpfr",
272
+ pgp: "application/pgp-encrypted",
273
+ pkg: "application/octet-stream",
274
+ pki: "application/pkixcmp",
275
+ pkipath: "application/pkix-pkipath",
276
+ pls: "application/pls+xml",
277
+ png: "image/png",
278
+ prc: "model/prc",
279
+ prf: "application/pics-rules",
280
+ provx: "application/provenance+xml",
281
+ ps: "application/postscript",
282
+ pskcxml: "application/pskc+xml",
283
+ pti: "image/prs.pti",
284
+ qt: "video/quicktime",
285
+ raml: "application/raml+yaml",
286
+ rapd: "application/route-apd+xml",
287
+ rdf: "application/rdf+xml",
288
+ relo: "application/p2p-overlay+xml",
289
+ rif: "application/reginfo+xml",
290
+ rl: "application/resource-lists+xml",
291
+ rld: "application/resource-lists-diff+xml",
292
+ rmi: "audio/midi",
293
+ rnc: "application/relax-ng-compact-syntax",
294
+ rng: "application/xml",
295
+ roa: "application/rpki-roa",
296
+ roff: "text/troff",
297
+ rq: "application/sparql-query",
298
+ rs: "application/rls-services+xml",
299
+ rsat: "application/atsc-rsat+xml",
300
+ rsd: "application/rsd+xml",
301
+ rsheet: "application/urc-ressheet+xml",
302
+ rss: "application/rss+xml",
303
+ rtf: "text/rtf",
304
+ rtx: "text/richtext",
305
+ rusd: "application/route-usd+xml",
306
+ s3m: "audio/s3m",
307
+ sbml: "application/sbml+xml",
308
+ scq: "application/scvp-cv-request",
309
+ scs: "application/scvp-cv-response",
310
+ sdp: "application/sdp",
311
+ senmlx: "application/senml+xml",
312
+ sensmlx: "application/sensml+xml",
313
+ ser: "application/java-serialized-object",
314
+ setpay: "application/set-payment-initiation",
315
+ setreg: "application/set-registration-initiation",
316
+ sgi: "image/sgi",
317
+ sgm: "text/sgml",
318
+ sgml: "text/sgml",
319
+ shex: "text/shex",
320
+ shf: "application/shf+xml",
321
+ shtml: "text/html",
322
+ sieve: "application/sieve",
323
+ sig: "application/pgp-signature",
324
+ sil: "audio/silk",
325
+ silo: "model/mesh",
326
+ siv: "application/sieve",
327
+ slim: "text/slim",
328
+ slm: "text/slim",
329
+ sls: "application/route-s-tsid+xml",
330
+ smi: "application/smil+xml",
331
+ smil: "application/smil+xml",
332
+ snd: "audio/basic",
333
+ so: "application/octet-stream",
334
+ spdx: "text/spdx",
335
+ spp: "application/scvp-vp-response",
336
+ spq: "application/scvp-vp-request",
337
+ spx: "audio/ogg",
338
+ sql: "application/sql",
339
+ sru: "application/sru+xml",
340
+ srx: "application/sparql-results+xml",
341
+ ssdl: "application/ssdl+xml",
342
+ ssml: "application/ssml+xml",
343
+ stk: "application/hyperstudio",
344
+ stl: "model/stl",
345
+ stpx: "model/step+xml",
346
+ stpxz: "model/step-xml+zip",
347
+ stpz: "model/step+zip",
348
+ styl: "text/stylus",
349
+ stylus: "text/stylus",
350
+ svg: "image/svg+xml",
351
+ svgz: "image/svg+xml",
352
+ swidtag: "application/swid+xml",
353
+ t: "text/troff",
354
+ t38: "image/t38",
355
+ td: "application/urc-targetdesc+xml",
356
+ tei: "application/tei+xml",
357
+ teicorpus: "application/tei+xml",
358
+ text: "text/plain",
359
+ tfi: "application/thraud+xml",
360
+ tfx: "image/tiff-fx",
361
+ tif: "image/tiff",
362
+ tiff: "image/tiff",
363
+ toml: "application/toml",
364
+ tr: "text/troff",
365
+ trig: "application/trig",
366
+ ts: "video/mp2t",
367
+ tsd: "application/timestamped-data",
368
+ tsv: "text/tab-separated-values",
369
+ ttc: "font/collection",
370
+ ttf: "font/ttf",
371
+ ttl: "text/turtle",
372
+ ttml: "application/ttml+xml",
373
+ txt: "text/plain",
374
+ u3d: "model/u3d",
375
+ u8dsn: "message/global-delivery-status",
376
+ u8hdr: "message/global-headers",
377
+ u8mdn: "message/global-disposition-notification",
378
+ u8msg: "message/global",
379
+ ubj: "application/ubjson",
380
+ uri: "text/uri-list",
381
+ uris: "text/uri-list",
382
+ urls: "text/uri-list",
383
+ vcard: "text/vcard",
384
+ vrml: "model/vrml",
385
+ vtt: "text/vtt",
386
+ vxml: "application/voicexml+xml",
387
+ war: "application/java-archive",
388
+ wasm: "application/wasm",
389
+ wav: "audio/wav",
390
+ weba: "audio/webm",
391
+ webm: "video/webm",
392
+ webmanifest: "application/manifest+json",
393
+ webp: "image/webp",
394
+ wgsl: "text/wgsl",
395
+ wgt: "application/widget",
396
+ wif: "application/watcherinfo+xml",
397
+ wmf: "image/wmf",
398
+ woff: "font/woff",
399
+ woff2: "font/woff2",
400
+ wrl: "model/vrml",
401
+ wsdl: "application/wsdl+xml",
402
+ wspolicy: "application/wspolicy+xml",
403
+ x3d: "model/x3d+xml",
404
+ x3db: "model/x3d+fastinfoset",
405
+ x3dbz: "model/x3d+binary",
406
+ x3dv: "model/x3d-vrml",
407
+ x3dvz: "model/x3d+vrml",
408
+ x3dz: "model/x3d+xml",
409
+ xaml: "application/xaml+xml",
410
+ xav: "application/xcap-att+xml",
411
+ xca: "application/xcap-caps+xml",
412
+ xcs: "application/calendar+xml",
413
+ xdf: "application/xcap-diff+xml",
414
+ xdssc: "application/dssc+xml",
415
+ xel: "application/xcap-el+xml",
416
+ xenc: "application/xenc+xml",
417
+ xer: "application/patch-ops-error+xml",
418
+ xfdf: "application/xfdf",
419
+ xht: "application/xhtml+xml",
420
+ xhtml: "application/xhtml+xml",
421
+ xhvml: "application/xv+xml",
422
+ xlf: "application/xliff+xml",
423
+ xm: "audio/xm",
424
+ xml: "text/xml",
425
+ xns: "application/xcap-ns+xml",
426
+ xop: "application/xop+xml",
427
+ xpl: "application/xproc+xml",
428
+ xsd: "application/xml",
429
+ xsf: "application/prs.xsf+xml",
430
+ xsl: "application/xml",
431
+ xslt: "application/xml",
432
+ xspf: "application/xspf+xml",
433
+ xvm: "application/xv+xml",
434
+ xvml: "application/xv+xml",
435
+ yaml: "text/yaml",
436
+ yang: "application/yang",
437
+ yin: "application/yin+xml",
438
+ yml: "text/yaml",
439
+ zip: "application/zip"
440
+ };
441
+ function lookup(extn) {
442
+ let tmp = ('' + extn).trim().toLowerCase(), idx = tmp.lastIndexOf('.');
443
+ return mimes[!~idx ? tmp : tmp.substring(++idx)];
444
+ }
445
+ export { lookup };
package/dist/743.js ADDED
@@ -0,0 +1,7 @@
1
+ import * as __rspack_external_node_buffer_fb286294 from "node:buffer";
2
+ import { __webpack_require__ } from "./rslib-runtime.js";
3
+ __webpack_require__.add({
4
+ "node:buffer" (module) {
5
+ module.exports = __rspack_external_node_buffer_fb286294;
6
+ }
7
+ });
@@ -1,11 +1,13 @@
1
- import { createRequire } from "node:module";
2
- import { dirname, join } from "node:path";
3
- import { fileURLToPath } from "node:url";
4
- let constants_dirname = dirname(fileURLToPath(import.meta.url));
5
- process.platform, join(constants_dirname), join(constants_dirname, '../static'), join(constants_dirname, 'client');
6
- let COMPILED_PATH = join(constants_dirname, '../compiled'), vendors_require = createRequire(import.meta.url), requireCompiledPackage = (name)=>vendors_require(`${COMPILED_PATH}/${name}/index.js`);
7
- requireCompiledPackage('picocolors');
8
- let transformLoader = async function transform(source, map) {
1
+ let mergeSourceMap = async (originalSourceMap, generatedSourceMap)=>{
2
+ if (!originalSourceMap || !generatedSourceMap) return generatedSourceMap ?? originalSourceMap;
3
+ let { default: remapping } = await import("./remapping.js").then((mod)=>({
4
+ default: mod.remapping
5
+ }));
6
+ return remapping([
7
+ generatedSourceMap,
8
+ originalSourceMap
9
+ ], ()=>null);
10
+ }, transformLoader = async function transform(source, map) {
9
11
  let callback = this.async(), bypass = ()=>{
10
12
  callback(null, source, map);
11
13
  }, { id: transformId, getEnvironment } = this.getOptions();
@@ -13,7 +15,6 @@ let transformLoader = async function transform(source, map) {
13
15
  let transform = this._compiler?.__rsbuildTransformer?.[transformId];
14
16
  if (!transform) return void bypass();
15
17
  try {
16
- var generatedSourceMap;
17
18
  let result = await transform({
18
19
  code: source,
19
20
  context: this.context,
@@ -30,10 +31,7 @@ let transformLoader = async function transform(source, map) {
30
31
  });
31
32
  if (null == result) return void bypass();
32
33
  if ('string' == typeof result || Buffer.isBuffer(result)) return void callback(null, result, map);
33
- let mergedMap = (generatedSourceMap = result.map, map && generatedSourceMap ? requireCompiledPackage('@jridgewell/remapping')([
34
- generatedSourceMap,
35
- map
36
- ], ()=>null) : generatedSourceMap ?? map);
34
+ let mergedMap = await mergeSourceMap(map, result.map);
37
35
  callback(null, result.code, mergedMap);
38
36
  } catch (error) {
39
37
  error instanceof Error ? callback(error) : callback(Error(String(error)));
@@ -113,7 +113,6 @@ function init(token, config, serverHost, serverPort, liveReload, browserLogs, lo
113
113
  handleSuccess();
114
114
  break;
115
115
  case 'static-changed':
116
- case 'content-changed':
117
116
  reloadPage();
118
117
  break;
119
118
  case 'warnings':
@@ -13,27 +13,8 @@ function _define_property(obj, key, value) {
13
13
  const { HTMLElement: HTMLElement = class {
14
14
  }, customElements: customElements } = "u" > typeof window ? window : globalThis;
15
15
  class ErrorOverlay extends HTMLElement {
16
- constructor(html){
16
+ init(html) {
17
17
  var _root_querySelector, _root_querySelector1;
18
- super(), _define_property(this, "close", (immediate = false)=>{
19
- const remove = ()=>{
20
- var _this_parentNode;
21
- return null == (_this_parentNode = this.parentNode) ? void 0 : _this_parentNode.removeChild(this);
22
- };
23
- if (this.animate && true !== immediate) this.animate([
24
- {
25
- opacity: 1
26
- },
27
- {
28
- opacity: 0
29
- }
30
- ], {
31
- duration: 300,
32
- easing: 'ease-out'
33
- }).addEventListener('finish', remove);
34
- else remove();
35
- });
36
- if (!this.attachShadow) return void logger.warn('[rsbuild] Error overlay disabled: Shadow DOM not supported in this browser.');
37
18
  const root = this.attachShadow({
38
19
  mode: 'open'
39
20
  });
@@ -53,6 +34,26 @@ class ErrorOverlay extends HTMLElement {
53
34
  };
54
35
  document.addEventListener('keydown', onEscKeydown);
55
36
  }
37
+ constructor(...args){
38
+ super(...args), _define_property(this, "close", (immediate = false)=>{
39
+ const remove = ()=>{
40
+ var _this_parentNode;
41
+ return null == (_this_parentNode = this.parentNode) ? void 0 : _this_parentNode.removeChild(this);
42
+ };
43
+ if (this.animate && true !== immediate) this.animate([
44
+ {
45
+ opacity: 1
46
+ },
47
+ {
48
+ opacity: 0
49
+ }
50
+ ], {
51
+ duration: 300,
52
+ easing: 'ease-out'
53
+ }).addEventListener('finish', remove);
54
+ else remove();
55
+ });
56
+ }
56
57
  }
57
58
  const overlayId = 'rsbuild-error-overlay';
58
59
  if (customElements && !customElements.get(overlayId)) customElements.define(overlayId, ErrorOverlay);
@@ -191,8 +192,18 @@ function getOverlayHtml(title, content) {
191
192
  `;
192
193
  }
193
194
  function createOverlay(title, content) {
195
+ const warn = ()=>{
196
+ logger.warn('[rsbuild] Error overlay disabled: Custom Elements not supported in this environment.');
197
+ };
198
+ if (!customElements || !customElements.get(overlayId)) return void warn();
194
199
  clearOverlay();
195
- document.body.appendChild(new ErrorOverlay(getOverlayHtml(title, content)));
200
+ try {
201
+ const overlay = document.createElement(overlayId);
202
+ overlay.init(getOverlayHtml(title, content));
203
+ document.body.appendChild(overlay);
204
+ } catch (_err) {
205
+ warn();
206
+ }
196
207
  }
197
208
  function clearOverlay() {
198
209
  document.querySelectorAll(overlayId).forEach((n)=>{