@rspack/binding 0.0.11 → 0.0.13

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 CHANGED
@@ -15,7 +15,12 @@ export interface RawCssPluginConfig {
15
15
  * For detailed configuration, see https://docs.rs/browserslist-rs/latest/browserslist/
16
16
  */
17
17
  presetEnv?: Array<string>
18
- modules?: boolean
18
+ modules?: RawCssModulesConfig
19
+ }
20
+ export interface RawCssModulesConfig {
21
+ localsConvention?: string
22
+ localIdentName?: string
23
+ exportsOnly?: boolean
19
24
  }
20
25
  export interface RawDecoratorOptions {
21
26
  legacy: boolean
@@ -72,11 +77,15 @@ export interface RawReactOptions {
72
77
  useSpread?: boolean
73
78
  refresh?: boolean
74
79
  }
80
+ export interface Minification {
81
+ passes?: number
82
+ enable?: boolean
83
+ }
75
84
  export interface RawBuiltins {
76
85
  html?: Array<RawHtmlPluginConfig>
77
86
  css?: RawCssPluginConfig
78
87
  postcss?: RawPostCssConfig
79
- minify?: boolean
88
+ minify?: Minification
80
89
  polyfill?: boolean
81
90
  browserslist?: Array<string>
82
91
  define?: Record<string, string>
@@ -86,6 +95,17 @@ export interface RawBuiltins {
86
95
  react?: RawReactOptions
87
96
  decorator?: RawDecoratorOptions
88
97
  }
98
+ export interface RawCacheOptions {
99
+ cacheType: string
100
+ maxGenerations: number
101
+ maxAge: number
102
+ profile: boolean
103
+ buildDependencies: Array<string>
104
+ cacheDirectory: string
105
+ cacheLocation: string
106
+ name: string
107
+ version: string
108
+ }
89
109
  export interface RawDevServer {
90
110
  hot?: boolean
91
111
  }
@@ -93,6 +113,9 @@ export interface RawEntryItem {
93
113
  import: Array<string>
94
114
  runtime?: string
95
115
  }
116
+ export interface RawExperiments {
117
+ lazyCompilation: boolean
118
+ }
96
119
  /**
97
120
  * `loader` is for js side loader, `builtin_loader` is for rust side loader,
98
121
  * which is mapped to real rust side loader by [get_builtin_loader].
@@ -127,6 +150,8 @@ export interface RawModuleRule {
127
150
  * - Regexp: It's tested with the input.
128
151
  */
129
152
  test?: RawModuleRuleCondition
153
+ include?: Array<RawModuleRuleCondition>
154
+ exclude?: Array<RawModuleRuleCondition>
130
155
  /**
131
156
  * A condition matcher matching an absolute path.
132
157
  * See `test` above
@@ -156,6 +181,7 @@ export interface RawModuleOptions {
156
181
  }
157
182
  export interface RawOptimizationOptions {
158
183
  splitChunks?: RawSplitChunksOptions
184
+ moduleIds?: string
159
185
  }
160
186
  export interface RawOutputOptions {
161
187
  path?: string
@@ -166,6 +192,7 @@ export interface RawOutputOptions {
166
192
  cssFilename?: string
167
193
  cssChunkFilename?: string
168
194
  uniqueName?: string
195
+ library?: string
169
196
  }
170
197
  export interface RawResolveOptions {
171
198
  preferRelative?: boolean
@@ -178,6 +205,16 @@ export interface RawResolveOptions {
178
205
  symlinks?: boolean
179
206
  tsConfigPath?: string
180
207
  }
208
+ export interface RawSnapshotStrategy {
209
+ hash: boolean
210
+ timestamp: boolean
211
+ }
212
+ export interface RawSnapshotOptions {
213
+ resolveBuildDependencies: RawSnapshotStrategy
214
+ buildDependencies: RawSnapshotStrategy
215
+ resolve: RawSnapshotStrategy
216
+ module: RawSnapshotStrategy
217
+ }
181
218
  export interface RawSplitChunksOptions {
182
219
  cacheGroups?: Record<string, RawCacheGroupOptions>
183
220
  /** What kind of chunks should be selected. */
@@ -207,6 +244,9 @@ export interface RawOptions {
207
244
  optimization?: RawOptimizationOptions
208
245
  stats?: RawStatsOptions
209
246
  devServer?: RawDevServer
247
+ snapshot?: RawSnapshotOptions
248
+ cache?: RawCacheOptions
249
+ experiments?: RawExperiments
210
250
  }
211
251
  export interface JsAssetInfoRelated {
212
252
  sourceMap?: string
@@ -324,6 +364,9 @@ export class JsCompilation {
324
364
  updateAsset(filename: string, newSourceOrFunction: JsCompatSource | ((source: JsCompatSource) => JsCompatSource), assetInfoUpdateOrFunction?: JsAssetInfo | ((assetInfo: JsAssetInfo) => JsAssetInfo)): void
325
365
  getAssets(): Readonly<JsAsset>[]
326
366
  getAsset(name: string): JsAsset | null
367
+ getAssetSource(name: string): JsCompatSource | null
368
+ getAssetFilenames(): Array<string>
369
+ hasAsset(name: string): boolean
327
370
  emitAsset(filename: string, source: JsCompatSource, assetInfo: JsAssetInfo): void
328
371
  deleteAsset(filename: string): void
329
372
  get assets(): Record<string, JsCompatSource>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/binding",
3
- "version": "0.0.11",
3
+ "version": "0.0.13",
4
4
  "description": "Node binding for rspack",
5
5
  "main": "binding.js",
6
6
  "types": "binding.d.ts",
@@ -9,8 +9,7 @@
9
9
  },
10
10
  "files": [
11
11
  "binding.js",
12
- "binding.d.ts",
13
- "*.node"
12
+ "binding.d.ts"
14
13
  ],
15
14
  "keywords": [],
16
15
  "author": "",
@@ -20,6 +19,11 @@
20
19
  "why-is-node-running": "2.2.1",
21
20
  "npm-run-all": "4.1.5"
22
21
  },
22
+ "optionalDependencies": {
23
+ "@rspack/binding-darwin-arm64": "0.0.13",
24
+ "@rspack/binding-darwin-x64": "0.0.13",
25
+ "@rspack/binding-linux-gnu-x64": "0.0.12"
26
+ },
23
27
  "scripts": {
24
28
  "build:debug": "napi build --platform --js false --dts binding.d.ts --config napirs.rc.json",
25
29
  "build:debug:x64": "napi build --platform --js false --dts binding.d.ts --config napirs.rc.json --target x86_64-apple-darwin",
Binary file