@rspack/binding 0.0.10 → 0.0.11
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 +45 -9
- package/package.json +6 -4
- package/rspack.darwin-arm64.node +0 -0
- package/rspack.darwin-x64.node +0 -0
- package/rspack.linux-x64-gnu.node +0 -0
package/binding.d.ts
CHANGED
|
@@ -14,7 +14,8 @@ export interface RawCssPluginConfig {
|
|
|
14
14
|
* The preset_env will finally pass into [`browserslist::resolve`](https://docs.rs/browserslist-rs/latest/browserslist/fn.resolve.html).
|
|
15
15
|
* For detailed configuration, see https://docs.rs/browserslist-rs/latest/browserslist/
|
|
16
16
|
*/
|
|
17
|
-
presetEnv
|
|
17
|
+
presetEnv?: Array<string>
|
|
18
|
+
modules?: boolean
|
|
18
19
|
}
|
|
19
20
|
export interface RawDecoratorOptions {
|
|
20
21
|
legacy: boolean
|
|
@@ -80,6 +81,7 @@ export interface RawBuiltins {
|
|
|
80
81
|
browserslist?: Array<string>
|
|
81
82
|
define?: Record<string, string>
|
|
82
83
|
treeShaking?: boolean
|
|
84
|
+
sideEffects?: boolean
|
|
83
85
|
progress?: RawProgressPluginConfig
|
|
84
86
|
react?: RawReactOptions
|
|
85
87
|
decorator?: RawDecoratorOptions
|
|
@@ -87,6 +89,10 @@ export interface RawBuiltins {
|
|
|
87
89
|
export interface RawDevServer {
|
|
88
90
|
hot?: boolean
|
|
89
91
|
}
|
|
92
|
+
export interface RawEntryItem {
|
|
93
|
+
import: Array<string>
|
|
94
|
+
runtime?: string
|
|
95
|
+
}
|
|
90
96
|
/**
|
|
91
97
|
* `loader` is for js side loader, `builtin_loader` is for rust side loader,
|
|
92
98
|
* which is mapped to real rust side loader by [get_builtin_loader].
|
|
@@ -104,12 +110,35 @@ export interface RawModuleRuleUse {
|
|
|
104
110
|
options?: string
|
|
105
111
|
loaderName?: string
|
|
106
112
|
}
|
|
113
|
+
export interface RawModuleRuleCondition {
|
|
114
|
+
/** Condition can be either a `string` or `Regexp`. */
|
|
115
|
+
type: "string" | "regexp"
|
|
116
|
+
/**
|
|
117
|
+
* Based on the condition type, the value can be either a `string` or `Regexp`.
|
|
118
|
+
* - "string": The value will be matched against the string.
|
|
119
|
+
* - "regexp": The value will be matched against the raw regexp source from JS side.
|
|
120
|
+
*/
|
|
121
|
+
matcher?: string
|
|
122
|
+
}
|
|
107
123
|
export interface RawModuleRule {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
124
|
+
/**
|
|
125
|
+
* A condition matcher matching an absolute path.
|
|
126
|
+
* - String: To match the input must start with the provided string. I. e. an absolute directory path, or absolute path to the file.
|
|
127
|
+
* - Regexp: It's tested with the input.
|
|
128
|
+
*/
|
|
129
|
+
test?: RawModuleRuleCondition
|
|
130
|
+
/**
|
|
131
|
+
* A condition matcher matching an absolute path.
|
|
132
|
+
* See `test` above
|
|
133
|
+
*/
|
|
134
|
+
resource?: RawModuleRuleCondition
|
|
135
|
+
/**
|
|
136
|
+
* A condition matcher against the resource query.
|
|
137
|
+
* TODO: align with webpack's `?` prefixed `resourceQuery`
|
|
138
|
+
*/
|
|
139
|
+
resourceQuery?: RawModuleRuleCondition
|
|
111
140
|
func?: (...args: any[]) => any
|
|
112
|
-
|
|
141
|
+
use?: Array<RawModuleRuleUse>
|
|
113
142
|
type?: "js" | "jsx" | "ts" | "tsx" | "css" | "json" | "asset" | "asset/resource" | "asset/source" | "asset/inline"
|
|
114
143
|
}
|
|
115
144
|
export interface RawAssetParserDataUrlOption {
|
|
@@ -134,6 +163,8 @@ export interface RawOutputOptions {
|
|
|
134
163
|
assetModuleFilename?: string
|
|
135
164
|
filename?: string
|
|
136
165
|
chunkFilename?: string
|
|
166
|
+
cssFilename?: string
|
|
167
|
+
cssChunkFilename?: string
|
|
137
168
|
uniqueName?: string
|
|
138
169
|
}
|
|
139
170
|
export interface RawResolveOptions {
|
|
@@ -145,10 +176,10 @@ export interface RawResolveOptions {
|
|
|
145
176
|
conditionNames?: Array<string>
|
|
146
177
|
alias?: Record<string, string | false>
|
|
147
178
|
symlinks?: boolean
|
|
148
|
-
|
|
179
|
+
tsConfigPath?: string
|
|
149
180
|
}
|
|
150
181
|
export interface RawSplitChunksOptions {
|
|
151
|
-
cacheGroups
|
|
182
|
+
cacheGroups?: Record<string, RawCacheGroupOptions>
|
|
152
183
|
/** What kind of chunks should be selected. */
|
|
153
184
|
chunks?: string
|
|
154
185
|
}
|
|
@@ -162,7 +193,7 @@ export interface RawStatsOptions {
|
|
|
162
193
|
colors: boolean
|
|
163
194
|
}
|
|
164
195
|
export interface RawOptions {
|
|
165
|
-
entry?: Record<string,
|
|
196
|
+
entry?: Record<string, RawEntryItem>
|
|
166
197
|
mode?: string
|
|
167
198
|
target?: string[]
|
|
168
199
|
context?: string
|
|
@@ -196,8 +227,9 @@ export interface JsAssetInfo {
|
|
|
196
227
|
* when asset is only used for development and doesn't count towards user-facing assets
|
|
197
228
|
*/
|
|
198
229
|
development: boolean
|
|
230
|
+
/** when asset ships data for updating an existing application (HMR) */
|
|
231
|
+
hotModuleReplacement: boolean
|
|
199
232
|
/**
|
|
200
|
-
* when asset ships data for updating an existing application (HMR)
|
|
201
233
|
* when asset is javascript and an ESM
|
|
202
234
|
* related object to other assets, keyed by type of relation (only points from parent to child)
|
|
203
235
|
*/
|
|
@@ -243,9 +275,11 @@ export interface JsStatsAsset {
|
|
|
243
275
|
chunks: Array<string>
|
|
244
276
|
chunkNames: Array<string>
|
|
245
277
|
info: JsStatsAssetInfo
|
|
278
|
+
emitted: boolean
|
|
246
279
|
}
|
|
247
280
|
export interface JsStatsAssetInfo {
|
|
248
281
|
development: boolean
|
|
282
|
+
hotModuleReplacement: boolean
|
|
249
283
|
}
|
|
250
284
|
export interface JsStatsModule {
|
|
251
285
|
type: string
|
|
@@ -289,7 +323,9 @@ export function initCustomTraceSubscriber(): void
|
|
|
289
323
|
export class JsCompilation {
|
|
290
324
|
updateAsset(filename: string, newSourceOrFunction: JsCompatSource | ((source: JsCompatSource) => JsCompatSource), assetInfoUpdateOrFunction?: JsAssetInfo | ((assetInfo: JsAssetInfo) => JsAssetInfo)): void
|
|
291
325
|
getAssets(): Readonly<JsAsset>[]
|
|
326
|
+
getAsset(name: string): JsAsset | null
|
|
292
327
|
emitAsset(filename: string, source: JsCompatSource, assetInfo: JsAssetInfo): void
|
|
328
|
+
deleteAsset(filename: string): void
|
|
293
329
|
get assets(): Record<string, JsCompatSource>
|
|
294
330
|
get entrypoints(): Record<string, JsChunkGroup>
|
|
295
331
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack/binding",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"description": "Node binding for rspack",
|
|
5
5
|
"main": "binding.js",
|
|
6
6
|
"types": "binding.d.ts",
|
|
@@ -17,11 +17,13 @@
|
|
|
17
17
|
"license": "ISC",
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@napi-rs/cli": "^2.6.2",
|
|
20
|
-
"why-is-node-running": "2.2.1"
|
|
20
|
+
"why-is-node-running": "2.2.1",
|
|
21
|
+
"npm-run-all": "4.1.5"
|
|
21
22
|
},
|
|
22
23
|
"scripts": {
|
|
23
|
-
"build": "napi build --platform --js false --dts binding.d.ts --config napirs.rc.json",
|
|
24
|
-
"build:
|
|
24
|
+
"build:debug": "napi build --platform --js false --dts binding.d.ts --config napirs.rc.json",
|
|
25
|
+
"build:debug:x64": "napi build --platform --js false --dts binding.d.ts --config napirs.rc.json --target x86_64-apple-darwin",
|
|
26
|
+
"build:release:all": "run-p build:release build:release:x64 build:release:linux",
|
|
25
27
|
"build:release": "napi build --release --platform --js false --dts binding.d.ts --config napirs.rc.json",
|
|
26
28
|
"build:release:x64": "napi build --release --platform --js false --dts binding.d.ts --config napirs.rc.json --target x86_64-apple-darwin",
|
|
27
29
|
"build:release:linux": "napi build --release --platform --js false --dts binding.d.ts --config napirs.rc.json --zig --target x86_64-unknown-linux-gnu --zig-abi-suffix=2.17"
|
package/rspack.darwin-arm64.node
CHANGED
|
Binary file
|
package/rspack.darwin-x64.node
DELETED
|
Binary file
|
|
Binary file
|