@rspack/binding 1.0.0-beta.3 → 1.0.0-beta.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/binding.d.ts +78 -25
- package/package.json +10 -10
package/binding.d.ts
CHANGED
|
@@ -19,15 +19,38 @@ export class ExternalObject<T> {
|
|
|
19
19
|
[K: symbol]: T
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
+
export class DependenciesBlockDto {
|
|
23
|
+
get dependencies(): Array<DependencyDto>
|
|
24
|
+
get blocks(): Array<DependenciesBlockDto>
|
|
25
|
+
}
|
|
26
|
+
export type DependenciesBlockDTO = DependenciesBlockDto
|
|
27
|
+
|
|
28
|
+
export class DependenciesDto {
|
|
29
|
+
get fileDependencies(): Array<string>
|
|
30
|
+
get addedFileDependencies(): Array<string>
|
|
31
|
+
get removedFileDependencies(): Array<string>
|
|
32
|
+
get contextDependencies(): Array<string>
|
|
33
|
+
get addedContextDependencies(): Array<string>
|
|
34
|
+
get removedContextDependencies(): Array<string>
|
|
35
|
+
get missingDependencies(): Array<string>
|
|
36
|
+
get addedMissingDependencies(): Array<string>
|
|
37
|
+
get removedMissingDependencies(): Array<string>
|
|
38
|
+
get buildDependencies(): Array<string>
|
|
39
|
+
get addedBuildDependencies(): Array<string>
|
|
40
|
+
get removedBuildDependencies(): Array<string>
|
|
41
|
+
}
|
|
42
|
+
export type DependenciesDTO = DependenciesDto
|
|
43
|
+
|
|
22
44
|
export class DependencyDto {
|
|
23
45
|
get type(): string
|
|
24
46
|
get category(): string
|
|
47
|
+
get request(): string | undefined
|
|
25
48
|
}
|
|
26
49
|
export type DependencyDTO = DependencyDto
|
|
27
50
|
|
|
28
51
|
export class EntryDataDto {
|
|
29
|
-
get dependencies(): Array<
|
|
30
|
-
get includeDependencies(): Array<
|
|
52
|
+
get dependencies(): Array<DependencyDTO>
|
|
53
|
+
get includeDependencies(): Array<DependencyDTO>
|
|
31
54
|
get options(): EntryOptionsDto
|
|
32
55
|
}
|
|
33
56
|
export type EntryDataDTO = EntryDataDto
|
|
@@ -57,7 +80,7 @@ export class JsCompilation {
|
|
|
57
80
|
getAssets(): Readonly<JsAsset>[]
|
|
58
81
|
getAsset(name: string): JsAsset | null
|
|
59
82
|
getAssetSource(name: string): JsCompatSource | null
|
|
60
|
-
|
|
83
|
+
get modules(): Array<ModuleDTO>
|
|
61
84
|
getOptimizationBailout(): Array<JsStatsOptimizationBailout>
|
|
62
85
|
getChunks(): Array<JsChunk>
|
|
63
86
|
getNamedChunkKeys(): Array<string>
|
|
@@ -75,10 +98,7 @@ export class JsCompilation {
|
|
|
75
98
|
get entrypoints(): Record<string, JsChunkGroup>
|
|
76
99
|
get chunkGroups(): Array<JsChunkGroup>
|
|
77
100
|
get hash(): string | null
|
|
78
|
-
|
|
79
|
-
getContextDependencies(): Array<string>
|
|
80
|
-
getMissingDependencies(): Array<string>
|
|
81
|
-
getBuildDependencies(): Array<string>
|
|
101
|
+
dependencies(): DependenciesDto
|
|
82
102
|
pushDiagnostic(diagnostic: JsDiagnostic): void
|
|
83
103
|
spliceDiagnostic(start: number, end: number, replaceWith: Array<JsDiagnostic>): void
|
|
84
104
|
pushNativeDiagnostics(diagnostics: ExternalObject<'Diagnostic[]'>): void
|
|
@@ -94,7 +114,7 @@ export class JsCompilation {
|
|
|
94
114
|
addMissingDependencies(deps: Array<string>): void
|
|
95
115
|
addBuildDependencies(deps: Array<string>): void
|
|
96
116
|
rebuildModule(moduleIdentifiers: Array<string>, f: (...args: any[]) => any): void
|
|
97
|
-
importModule(request: string, publicPath: JsFilename | undefined | null, baseUri: string | undefined | null, originalModule: string | undefined | null, originalModuleContext: string | undefined | null, callback: (...args: any[]) => any): void
|
|
117
|
+
importModule(request: string, layer: string | undefined | null, publicPath: JsFilename | undefined | null, baseUri: string | undefined | null, originalModule: string | undefined | null, originalModuleContext: string | undefined | null, callback: (...args: any[]) => any): void
|
|
98
118
|
get entries(): JsEntries
|
|
99
119
|
}
|
|
100
120
|
|
|
@@ -126,6 +146,23 @@ export class JsStats {
|
|
|
126
146
|
getLogging(acceptedTypes: number): Array<JsStatsLogging>
|
|
127
147
|
}
|
|
128
148
|
|
|
149
|
+
export class ModuleDto {
|
|
150
|
+
get context(): string | undefined
|
|
151
|
+
get originalSource(): JsCompatSource | undefined
|
|
152
|
+
get resource(): string | undefined
|
|
153
|
+
get moduleIdentifier(): string
|
|
154
|
+
get nameForCondition(): string | undefined
|
|
155
|
+
get request(): string | undefined
|
|
156
|
+
get userRequest(): string | undefined
|
|
157
|
+
get rawRequest(): string | undefined
|
|
158
|
+
get factoryMeta(): JsFactoryMeta | undefined
|
|
159
|
+
get type(): string
|
|
160
|
+
get layer(): string | undefined
|
|
161
|
+
get blocks(): Array<DependenciesBlockDto>
|
|
162
|
+
size(ty?: string | undefined | null): number
|
|
163
|
+
}
|
|
164
|
+
export type ModuleDTO = ModuleDto
|
|
165
|
+
|
|
129
166
|
export class Rspack {
|
|
130
167
|
constructor(options: RawOptions, builtinPlugins: Array<BuiltinPlugin>, registerJsTaps: RegisterJsTaps, outputFilesystem: ThreadsafeNodeFS, resolverFactoryReference: JsResolverFactory)
|
|
131
168
|
setNonSkippableRegisters(kinds: Array<RegisterJsTapKind>): void
|
|
@@ -230,7 +267,6 @@ export enum BuiltinPluginName {
|
|
|
230
267
|
CopyRspackPlugin = 'CopyRspackPlugin',
|
|
231
268
|
HtmlRspackPlugin = 'HtmlRspackPlugin',
|
|
232
269
|
SwcJsMinimizerRspackPlugin = 'SwcJsMinimizerRspackPlugin',
|
|
233
|
-
SwcCssMinimizerRspackPlugin = 'SwcCssMinimizerRspackPlugin',
|
|
234
270
|
LightningCssMinimizerRspackPlugin = 'LightningCssMinimizerRspackPlugin',
|
|
235
271
|
BundlerInfoRspackPlugin = 'BundlerInfoRspackPlugin',
|
|
236
272
|
CssExtractRspackPlugin = 'CssExtractRspackPlugin',
|
|
@@ -309,6 +345,8 @@ export interface JsAssetInfo {
|
|
|
309
345
|
* Related: packages/rspack/src/Compilation.ts
|
|
310
346
|
*/
|
|
311
347
|
extras: Record<string, any>
|
|
348
|
+
/** whether this asset is over the size limit */
|
|
349
|
+
isOverSizeLimit?: boolean
|
|
312
350
|
}
|
|
313
351
|
|
|
314
352
|
export interface JsAssetInfoRelated {
|
|
@@ -326,6 +364,10 @@ export interface JsBuildTimeExecutionOption {
|
|
|
326
364
|
baseUri?: string
|
|
327
365
|
}
|
|
328
366
|
|
|
367
|
+
export interface JsCacheGroupTestCtx {
|
|
368
|
+
module: ModuleDTO
|
|
369
|
+
}
|
|
370
|
+
|
|
329
371
|
export interface JsChunk {
|
|
330
372
|
__inner_ukey: number
|
|
331
373
|
__inner_groups: Array<number>
|
|
@@ -406,8 +448,8 @@ export interface JsDiagnostic {
|
|
|
406
448
|
}
|
|
407
449
|
|
|
408
450
|
export interface JsEntryData {
|
|
409
|
-
dependencies: Array<
|
|
410
|
-
includeDependencies: Array<
|
|
451
|
+
dependencies: Array<DependencyDTO>
|
|
452
|
+
includeDependencies: Array<DependencyDTO>
|
|
411
453
|
options: JsEntryOptions
|
|
412
454
|
}
|
|
413
455
|
|
|
@@ -641,6 +683,7 @@ export interface JsStatsAssetInfo {
|
|
|
641
683
|
contenthash: Array<string>
|
|
642
684
|
fullhash: Array<string>
|
|
643
685
|
related: Array<JsStatsAssetInfoRelated>
|
|
686
|
+
isOverSizeLimit?: boolean
|
|
644
687
|
}
|
|
645
688
|
|
|
646
689
|
export interface JsStatsAssetInfoRelated {
|
|
@@ -653,6 +696,11 @@ export interface JsStatsAssetsByChunkName {
|
|
|
653
696
|
files: Array<string>
|
|
654
697
|
}
|
|
655
698
|
|
|
699
|
+
export interface JsStatsChildGroupChildAssets {
|
|
700
|
+
preload?: Array<string>
|
|
701
|
+
prefetch?: Array<string>
|
|
702
|
+
}
|
|
703
|
+
|
|
656
704
|
export interface JsStatsChunk {
|
|
657
705
|
type: string
|
|
658
706
|
files: Array<string>
|
|
@@ -683,7 +731,9 @@ export interface JsStatsChunkGroup {
|
|
|
683
731
|
assetsSize: number
|
|
684
732
|
auxiliaryAssets?: Array<JsStatsChunkGroupAsset>
|
|
685
733
|
auxiliaryAssetsSize?: number
|
|
734
|
+
isOverSizeLimit?: boolean
|
|
686
735
|
children?: JsStatsChunkGroupChildren
|
|
736
|
+
childAssets?: JsStatsChildGroupChildAssets
|
|
687
737
|
}
|
|
688
738
|
|
|
689
739
|
export interface JsStatsChunkGroupAsset {
|
|
@@ -789,6 +839,8 @@ export interface JsStatsModuleProfile {
|
|
|
789
839
|
|
|
790
840
|
export interface JsStatsModuleReason {
|
|
791
841
|
moduleDescriptor?: JsModuleDescriptor
|
|
842
|
+
resolvedModuleDescriptor?: JsModuleDescriptor
|
|
843
|
+
moduleChunks?: number
|
|
792
844
|
type?: string
|
|
793
845
|
userRequest?: string
|
|
794
846
|
}
|
|
@@ -950,13 +1002,12 @@ export interface RawCacheGroupOptions {
|
|
|
950
1002
|
maxSize?: number | RawSplitChunkSizes
|
|
951
1003
|
maxAsyncSize?: number | RawSplitChunkSizes
|
|
952
1004
|
maxInitialSize?: number | RawSplitChunkSizes
|
|
1005
|
+
maxAsyncRequests?: number
|
|
1006
|
+
maxInitialRequests?: number
|
|
953
1007
|
name?: string | false | Function
|
|
954
1008
|
reuseExistingChunk?: boolean
|
|
955
1009
|
enforce?: boolean
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
export interface RawCacheGroupTestCtx {
|
|
959
|
-
module: JsModule
|
|
1010
|
+
usedExports?: boolean
|
|
960
1011
|
}
|
|
961
1012
|
|
|
962
1013
|
export interface RawCacheOptions {
|
|
@@ -1177,6 +1228,11 @@ export interface RawGeneratorOptions {
|
|
|
1177
1228
|
cssModule?: RawCssModuleGeneratorOptions
|
|
1178
1229
|
}
|
|
1179
1230
|
|
|
1231
|
+
export interface RawHtmlRspackPluginBaseOptions {
|
|
1232
|
+
href?: string
|
|
1233
|
+
target?: "_self" | "_blank" | "_parent" | "_top"
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1180
1236
|
export interface RawHtmlRspackPluginOptions {
|
|
1181
1237
|
/** emitted file name in output path */
|
|
1182
1238
|
filename?: string
|
|
@@ -1188,16 +1244,18 @@ export interface RawHtmlRspackPluginOptions {
|
|
|
1188
1244
|
inject: "head" | "body" | "false"
|
|
1189
1245
|
/** path or `auto` */
|
|
1190
1246
|
publicPath?: string
|
|
1191
|
-
/** `blocking`, `defer`, or `module` */
|
|
1192
|
-
scriptLoading: "blocking" | "defer" | "module"
|
|
1247
|
+
/** `blocking`, `defer`, `module` or `systemjs-module` */
|
|
1248
|
+
scriptLoading: "blocking" | "defer" | "module" | "systemjs-module"
|
|
1193
1249
|
/** entry_chunk_name (only entry chunks are supported) */
|
|
1194
1250
|
chunks?: Array<string>
|
|
1195
|
-
|
|
1251
|
+
excludeChunks?: Array<string>
|
|
1196
1252
|
sri?: "sha256" | "sha384" | "sha512"
|
|
1197
1253
|
minify?: boolean
|
|
1198
1254
|
title?: string
|
|
1199
1255
|
favicon?: string
|
|
1200
1256
|
meta?: Record<string, Record<string, string>>
|
|
1257
|
+
hash?: boolean
|
|
1258
|
+
base?: RawHtmlRspackPluginBaseOptions
|
|
1201
1259
|
}
|
|
1202
1260
|
|
|
1203
1261
|
export interface RawHttpExternalsRspackPluginOptions {
|
|
@@ -1261,7 +1319,7 @@ export interface RawLightningCssBrowsers {
|
|
|
1261
1319
|
|
|
1262
1320
|
export interface RawLightningCssMinimizerOptions {
|
|
1263
1321
|
errorRecovery: boolean
|
|
1264
|
-
targets?:
|
|
1322
|
+
targets?: Array<string>
|
|
1265
1323
|
include?: number
|
|
1266
1324
|
exclude?: number
|
|
1267
1325
|
draft?: RawDraft
|
|
@@ -1637,6 +1695,7 @@ export interface RawSplitChunksOptions {
|
|
|
1637
1695
|
cacheGroups?: Array<RawCacheGroupOptions>
|
|
1638
1696
|
/** What kind of chunks should be selected. */
|
|
1639
1697
|
chunks?: RegExp | 'async' | 'initial' | 'all' | Function
|
|
1698
|
+
usedExports?: boolean
|
|
1640
1699
|
automaticNameDelimiter?: string
|
|
1641
1700
|
maxAsyncRequests?: number
|
|
1642
1701
|
maxInitialRequests?: number
|
|
@@ -1655,12 +1714,6 @@ export interface RawStatsOptions {
|
|
|
1655
1714
|
colors: boolean
|
|
1656
1715
|
}
|
|
1657
1716
|
|
|
1658
|
-
export interface RawSwcCssMinimizerRspackPluginOptions {
|
|
1659
|
-
test?: string | RegExp | (string | RegExp)[]
|
|
1660
|
-
include?: string | RegExp | (string | RegExp)[]
|
|
1661
|
-
exclude?: string | RegExp | (string | RegExp)[]
|
|
1662
|
-
}
|
|
1663
|
-
|
|
1664
1717
|
export interface RawSwcJsMinimizerOptions {
|
|
1665
1718
|
compress: any
|
|
1666
1719
|
mangle: any
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack/binding",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Node binding for rspack",
|
|
6
6
|
"main": "binding.js",
|
|
@@ -24,15 +24,15 @@
|
|
|
24
24
|
"binaryName": "rspack"
|
|
25
25
|
},
|
|
26
26
|
"optionalDependencies": {
|
|
27
|
-
"@rspack/binding-
|
|
28
|
-
"@rspack/binding-win32-arm64-msvc": "1.0.0-beta.
|
|
29
|
-
"@rspack/binding-
|
|
30
|
-
"@rspack/binding-linux-arm64-gnu": "1.0.0-beta.
|
|
31
|
-
"@rspack/binding-win32-ia32-msvc": "1.0.0-beta.
|
|
32
|
-
"@rspack/binding-win32-x64-msvc": "1.0.0-beta.
|
|
33
|
-
"@rspack/binding-darwin-x64": "1.0.0-beta.
|
|
34
|
-
"@rspack/binding-linux-x64-gnu": "1.0.0-beta.
|
|
35
|
-
"@rspack/binding-linux-x64-musl": "1.0.0-beta.
|
|
27
|
+
"@rspack/binding-darwin-arm64": "1.0.0-beta.5",
|
|
28
|
+
"@rspack/binding-win32-arm64-msvc": "1.0.0-beta.5",
|
|
29
|
+
"@rspack/binding-linux-arm64-musl": "1.0.0-beta.5",
|
|
30
|
+
"@rspack/binding-linux-arm64-gnu": "1.0.0-beta.5",
|
|
31
|
+
"@rspack/binding-win32-ia32-msvc": "1.0.0-beta.5",
|
|
32
|
+
"@rspack/binding-win32-x64-msvc": "1.0.0-beta.5",
|
|
33
|
+
"@rspack/binding-darwin-x64": "1.0.0-beta.5",
|
|
34
|
+
"@rspack/binding-linux-x64-gnu": "1.0.0-beta.5",
|
|
35
|
+
"@rspack/binding-linux-x64-musl": "1.0.0-beta.5"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"build:debug": "node scripts/build.js",
|