@rspack/binding 1.2.3 → 1.2.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.
Files changed (2) hide show
  1. package/binding.d.ts +34 -14
  2. package/package.json +14 -28
package/binding.d.ts CHANGED
@@ -78,6 +78,7 @@ export declare class JsChunkGraph {
78
78
  getChunkModulesIterableBySourceType(chunk: JsChunk, sourceType: string): JsModule[]
79
79
  getModuleChunks(module: JsModule): JsChunk[]
80
80
  getModuleId(jsModule: JsModule): string | null
81
+ getModuleHash(module: JsModule, runtime: string | string[] | undefined): string | null
81
82
  getBlockChunkGroup(jsBlock: JsDependenciesBlock): JsChunkGroup | null
82
83
  }
83
84
 
@@ -148,6 +149,15 @@ export declare class JsCompilation {
148
149
  addInclude(args: [string, RawDependency, JsEntryOptions | undefined][], callback: (errMsg: Error | null, results: [string | null, JsModule][]) => void): void
149
150
  }
150
151
 
152
+ export declare class JsCompiler {
153
+ constructor(compilerPath: string, options: RawOptions, builtinPlugins: Array<BuiltinPlugin>, registerJsTaps: RegisterJsTaps, outputFilesystem: ThreadsafeNodeFS, intermediateFilesystem: ThreadsafeNodeFS | undefined | null, resolverFactoryReference: JsResolverFactory)
154
+ setNonSkippableRegisters(kinds: Array<RegisterJsTapKind>): void
155
+ /** Build with the given option passed to the constructor */
156
+ build(callback: (err: null | Error) => void): void
157
+ /** Rebuild with the given option passed to the constructor */
158
+ rebuild(changed_files: string[], removed_files: string[], callback: (err: null | Error) => void): void
159
+ }
160
+
151
161
  export declare class JsContextModuleFactoryAfterResolveData {
152
162
  get resource(): string
153
163
  set resource(resource: string)
@@ -287,15 +297,6 @@ export declare class RawExternalItemFnCtx {
287
297
  getResolver(): JsResolver
288
298
  }
289
299
 
290
- export declare class Rspack {
291
- constructor(compilerPath: string, options: RawOptions, builtinPlugins: Array<BuiltinPlugin>, registerJsTaps: RegisterJsTaps, outputFilesystem: ThreadsafeNodeFS, intermediateFilesystem: ThreadsafeNodeFS | undefined | null, resolverFactoryReference: JsResolverFactory)
292
- setNonSkippableRegisters(kinds: Array<RegisterJsTapKind>): void
293
- /** Build with the given option passed to the constructor */
294
- build(callback: (err: null | Error) => void): void
295
- /** Rebuild with the given option passed to the constructor */
296
- rebuild(changed_files: string[], removed_files: string[], callback: (err: null | Error) => void): void
297
- }
298
-
299
300
  export interface BuiltinPlugin {
300
301
  name: BuiltinPluginName
301
302
  options: unknown
@@ -380,7 +381,8 @@ export declare enum BuiltinPluginName {
380
381
  CssExtractRspackPlugin = 'CssExtractRspackPlugin',
381
382
  RsdoctorPlugin = 'RsdoctorPlugin',
382
383
  JsLoaderRspackPlugin = 'JsLoaderRspackPlugin',
383
- LazyCompilationPlugin = 'LazyCompilationPlugin'
384
+ LazyCompilationPlugin = 'LazyCompilationPlugin',
385
+ SubresourceIntegrityPlugin = 'SubresourceIntegrityPlugin'
384
386
  }
385
387
 
386
388
  export declare function cleanupGlobalTrace(): void
@@ -534,8 +536,6 @@ export interface JsBuildMeta {
534
536
  esm: boolean
535
537
  exportsType: 'unset' | 'default' | 'namespace' | 'flagged' | 'dynamic'
536
538
  defaultObject: 'false' | 'redirect' | JsBuildMetaDefaultObjectRedirectWarn
537
- moduleArgument: 'module' | 'webpackModule'
538
- exportsArgument: 'exports' | 'webpackExports'
539
539
  sideEffectFree?: boolean
540
540
  exportsFinalName?: Array<[string, string]> | undefined
541
541
  }
@@ -1400,6 +1400,7 @@ export interface RawCacheGroupOptions {
1400
1400
  automaticNameDelimiter?: string
1401
1401
  minChunks?: number
1402
1402
  minSize?: number | RawSplitChunkSizes
1403
+ minSizeReduction?: number | RawSplitChunkSizes
1403
1404
  maxSize?: number | RawSplitChunkSizes
1404
1405
  maxAsyncSize?: number | RawSplitChunkSizes
1405
1406
  maxInitialSize?: number | RawSplitChunkSizes
@@ -1669,8 +1670,10 @@ export interface RawFlagAllModulesAsUsedPluginOptions {
1669
1670
  export interface RawFuncUseCtx {
1670
1671
  resource?: string
1671
1672
  realResource?: string
1672
- resourceQuery?: string
1673
- issuer?: string
1673
+ resourceQuery: string
1674
+ resourceFragment: string
1675
+ issuer: string
1676
+ issuerLayer: string
1674
1677
  }
1675
1678
 
1676
1679
  export interface RawGeneratorOptions {
@@ -1755,6 +1758,15 @@ export interface RawInfo {
1755
1758
  version?: string
1756
1759
  }
1757
1760
 
1761
+ export interface RawIntegrityData {
1762
+ integerities: Array<RawIntegrityItem>
1763
+ }
1764
+
1765
+ export interface RawIntegrityItem {
1766
+ asset: string
1767
+ integrity: string
1768
+ }
1769
+
1758
1770
  export interface RawJavascriptParserOptions {
1759
1771
  dynamicImportMode?: string
1760
1772
  dynamicImportPreload?: string
@@ -2211,6 +2223,7 @@ export interface RawSplitChunkSizes {
2211
2223
  export interface RawSplitChunksOptions {
2212
2224
  fallbackCacheGroup?: RawFallbackCacheGroupOptions
2213
2225
  name?: string | false | Function
2226
+ filename?: JsFilename
2214
2227
  cacheGroups?: Array<RawCacheGroupOptions>
2215
2228
  /** What kind of chunks should be selected. */
2216
2229
  chunks?: RegExp | 'async' | 'initial' | 'all' | Function
@@ -2222,6 +2235,7 @@ export interface RawSplitChunksOptions {
2222
2235
  minChunks?: number
2223
2236
  hidePathInfo?: boolean
2224
2237
  minSize?: number | RawSplitChunkSizes
2238
+ minSizeReduction?: number | RawSplitChunkSizes
2225
2239
  enforceSizeThreshold?: number
2226
2240
  minRemainingSize?: number | RawSplitChunkSizes
2227
2241
  maxSize?: number | RawSplitChunkSizes
@@ -2238,6 +2252,12 @@ export interface RawStorageOptions {
2238
2252
  directory: string
2239
2253
  }
2240
2254
 
2255
+ export interface RawSubresourceIntegrityPluginOptions {
2256
+ integrityCallback?: (data: RawIntegrityData) => void
2257
+ hashFuncNames: Array<string>
2258
+ htmlPlugin: "JavaScript" | "Native" | "Disabled"
2259
+ }
2260
+
2241
2261
  export interface RawSwcJsMinimizerOptions {
2242
2262
  compress: any
2243
2263
  mangle: any
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/binding",
3
- "version": "1.2.3",
3
+ "version": "1.2.5",
4
4
  "license": "MIT",
5
5
  "description": "Node binding for rspack",
6
6
  "main": "binding.js",
@@ -24,35 +24,21 @@
24
24
  "binaryName": "rspack"
25
25
  },
26
26
  "optionalDependencies": {
27
- "@rspack/binding-darwin-arm64": "1.2.3",
28
- "@rspack/binding-linux-arm64-gnu": "1.2.3",
29
- "@rspack/binding-win32-arm64-msvc": "1.2.3",
30
- "@rspack/binding-win32-ia32-msvc": "1.2.3",
31
- "@rspack/binding-linux-arm64-musl": "1.2.3",
32
- "@rspack/binding-darwin-x64": "1.2.3",
33
- "@rspack/binding-win32-x64-msvc": "1.2.3",
34
- "@rspack/binding-linux-x64-gnu": "1.2.3",
35
- "@rspack/binding-linux-x64-musl": "1.2.3"
27
+ "@rspack/binding-darwin-arm64": "1.2.5",
28
+ "@rspack/binding-linux-arm64-gnu": "1.2.5",
29
+ "@rspack/binding-linux-arm64-musl": "1.2.5",
30
+ "@rspack/binding-win32-arm64-msvc": "1.2.5",
31
+ "@rspack/binding-win32-ia32-msvc": "1.2.5",
32
+ "@rspack/binding-win32-x64-msvc": "1.2.5",
33
+ "@rspack/binding-darwin-x64": "1.2.5",
34
+ "@rspack/binding-linux-x64-gnu": "1.2.5",
35
+ "@rspack/binding-linux-x64-musl": "1.2.5"
36
36
  },
37
37
  "scripts": {
38
- "build:debug": "node scripts/build.js",
39
- "watch:debug": "node scripts/build.js --watch",
40
- "build:debug:x64": "cross-env RUST_TARGET=x86_64-apple-darwin node scripts/build.js",
41
- "build:debug:linux": "cross-env RUST_TARGET=x86_64-unknown-linux-gnu node scripts/build.js",
42
- "build:release": "node scripts/build.js --release",
43
- "watch:release": "node scripts/build.js --release --watch",
44
- "build:release:arm64": "cross-env RUST_TARGET=aarch64-apple-darwin node scripts/build.js --release",
45
- "build:release:x64": "cross-env RUST_TARGET=x86_64-apple-darwin node scripts/build.js --release",
46
- "build:release:linux": "cross-env RUST_TARGET=x86_64-unknown-linux-gnu node scripts/build.js --release",
47
- "build:release:musl": "cross-env RUST_TARGET=aarch64-unknown-linux-musl node scripts/build.js --release",
48
- "build:release:win": "cross-env RUST_TARGET=x86_64-pc-windows-msvc node scripts/build.js --release",
49
- "build:release-prod": "node scripts/build.js --release-prod",
50
- "watch:release-prod": "node scripts/build.js --release-prod --watch",
51
- "build:release-prod:arm64": "cross-env RUST_TARGET=aarch64-apple-darwin node scripts/build.js --release-prod",
52
- "build:release-prod:x64": "cross-env RUST_TARGET=x86_64-apple-darwin node scripts/build.js --release-prod",
53
- "build:release-prod:linux": "cross-env RUST_TARGET=x86_64-unknown-linux-gnu node scripts/build.js --release-prod",
54
- "build:release-prod:win": "cross-env RUST_TARGET=x86_64-pc-windows-msvc node scripts/build.js --release-prod",
55
- "build:release-debug": "node scripts/build.js --release-debug",
38
+ "build:dev": "node scripts/build.js",
39
+ "build:ci": "node scripts/build.js --profile ci",
40
+ "build:profiling": "node scripts/build.js --profile profiling",
41
+ "build:release": "node scripts/build.js --profile release",
56
42
  "move-binding": "node scripts/move-binding",
57
43
  "test": "tsc -p tsconfig.type-test.json"
58
44
  }