@ohos-ports/rspack-binding 2.2.2-beta.0 → 2.3.2-beta.0
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/README.md +12 -0
- package/binding.d.ts +2 -2
- package/binding.js +2 -2
- package/napi-binding.d.ts +334 -241
- package/package.json +14 -6
- package/rspack.openharmony-arm64-ohos.node +0 -4
package/README.md
CHANGED
|
@@ -19,3 +19,15 @@ The generation of `rspack.wasi-browser.js` and `rspack.wasi.js` is disabled by d
|
|
|
19
19
|
## License
|
|
20
20
|
|
|
21
21
|
Rspack is [MIT licensed](https://github.com/web-infra-dev/rspack/blob/main/LICENSE).
|
|
22
|
+
|
|
23
|
+
## OpenHarmony port
|
|
24
|
+
|
|
25
|
+
This is the `@ohos-ports` distribution of `@rspack/binding@2.3.2`.
|
|
26
|
+
|
|
27
|
+
- On `process.platform === 'openharmony'` and `process.arch === 'arm64'`,
|
|
28
|
+
the loader probes the local `rspack.linux-arm64-ohos.node` slot first and
|
|
29
|
+
then `@ohos-ports/rspack-binding-openharmony-arm64` (installed
|
|
30
|
+
automatically via `optionalDependencies`), which ships the native binary
|
|
31
|
+
compiled from rspack v2.3.2 source for `aarch64-unknown-linux-ohos` and
|
|
32
|
+
signed with `binary-sign-tool`.
|
|
33
|
+
- Upstream probe behavior on all other platforms is unchanged.
|
package/binding.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* We manually create binding.d.ts and re-export everything of the dts generated by napi to fix the cjs-esm interop
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import * as binding from "./napi-binding";
|
|
5
|
+
import * as binding from "./napi-binding.js";
|
|
6
6
|
|
|
7
|
-
export * from "./napi-binding"
|
|
7
|
+
export * from "./napi-binding.js"
|
|
8
8
|
export default binding;
|
package/binding.js
CHANGED
|
@@ -320,12 +320,12 @@ function requireNative() {
|
|
|
320
320
|
} else if (process.platform === 'openharmony') {
|
|
321
321
|
if (process.arch === 'arm64') {
|
|
322
322
|
try {
|
|
323
|
-
return require('./rspack.
|
|
323
|
+
return require('./rspack.linux-arm64-ohos.node')
|
|
324
324
|
} catch (e) {
|
|
325
325
|
loadErrors.push(e)
|
|
326
326
|
}
|
|
327
327
|
try {
|
|
328
|
-
return require('@rspack
|
|
328
|
+
return require('@ohos-ports/rspack-binding-openharmony-arm64')
|
|
329
329
|
} catch (e) {
|
|
330
330
|
loadErrors.push(e)
|
|
331
331
|
}
|
package/napi-binding.d.ts
CHANGED
|
@@ -12,73 +12,26 @@ export type AssetInfo = KnownAssetInfo & Record<string, any>;
|
|
|
12
12
|
|
|
13
13
|
export type CustomPluginName = string;
|
|
14
14
|
|
|
15
|
-
export
|
|
16
|
-
|
|
17
|
-
export const COMPILATION_HOOKS_MAP_SYMBOL: unique symbol;
|
|
18
|
-
|
|
19
|
-
export const BUILD_INFO_ASSETS_SYMBOL: unique symbol;
|
|
20
|
-
export const BUILD_INFO_FILE_DEPENDENCIES_SYMBOL: unique symbol;
|
|
21
|
-
export const BUILD_INFO_CONTEXT_DEPENDENCIES_SYMBOL: unique symbol;
|
|
22
|
-
export const BUILD_INFO_MISSING_DEPENDENCIES_SYMBOL: unique symbol;
|
|
23
|
-
export const BUILD_INFO_BUILD_DEPENDENCIES_SYMBOL: unique symbol;
|
|
24
|
-
export const COMMIT_CUSTOM_FIELDS_SYMBOL: unique symbol;
|
|
25
|
-
|
|
26
|
-
export const RUST_ERROR_SYMBOL: unique symbol;
|
|
27
|
-
|
|
28
|
-
export const CIRCULAR_CONNECTION_SYMBOL: unique symbol;
|
|
29
|
-
export const TRANSITIVE_ONLY_SYMBOL: unique symbol;
|
|
30
|
-
export type ConnectionState = boolean | typeof CIRCULAR_CONNECTION_SYMBOL | typeof TRANSITIVE_ONLY_SYMBOL;
|
|
31
|
-
|
|
32
|
-
interface KnownBuildInfo {
|
|
33
|
-
[BUILD_INFO_ASSETS_SYMBOL]: Assets,
|
|
34
|
-
[BUILD_INFO_FILE_DEPENDENCIES_SYMBOL]: string[],
|
|
35
|
-
[BUILD_INFO_CONTEXT_DEPENDENCIES_SYMBOL]: string[],
|
|
36
|
-
[BUILD_INFO_MISSING_DEPENDENCIES_SYMBOL]: string[],
|
|
37
|
-
[BUILD_INFO_BUILD_DEPENDENCIES_SYMBOL]: string[],
|
|
38
|
-
[COMMIT_CUSTOM_FIELDS_SYMBOL](): void;
|
|
39
|
-
}
|
|
15
|
+
export type ConnectionState = boolean | symbol;
|
|
40
16
|
|
|
41
17
|
export type BuildInfo = KnownBuildInfo & Record<string, any>;
|
|
42
18
|
|
|
43
19
|
export interface Module {
|
|
44
20
|
readonly type: string;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
get useSimpleSourceMap(): boolean;
|
|
21
|
+
readonly context: string | undefined;
|
|
22
|
+
readonly layer: string | undefined;
|
|
23
|
+
readonly useSourceMap: boolean;
|
|
24
|
+
readonly useSimpleSourceMap: boolean;
|
|
25
|
+
factoryMeta: JsFactoryMeta;
|
|
51
26
|
buildInfo: BuildInfo;
|
|
52
27
|
buildMeta: Record<string, any>;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
export var NormalModule: NormalModuleConstructor;
|
|
61
|
-
|
|
62
|
-
export interface NormalModule extends Module {
|
|
63
|
-
readonly resource: string;
|
|
64
|
-
readonly request: string;
|
|
65
|
-
readonly userRequest: string;
|
|
66
|
-
readonly rawRequest: string;
|
|
67
|
-
readonly resourceResolveData: Readonly<JsResourceData> | undefined;
|
|
68
|
-
readonly loaders: JsLoaderItem[];
|
|
69
|
-
get matchResource(): string | undefined;
|
|
70
|
-
set matchResource(val: string | undefined);
|
|
71
|
-
get error(): RspackError | undefined;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export interface ConcatenatedModule extends Module {
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export interface ContextModule extends Module {
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export interface ExternalModule extends Module {
|
|
81
|
-
readonly userRequest: string;
|
|
28
|
+
readonly blocks: AsyncDependenciesBlock[];
|
|
29
|
+
readonly dependencies: Dependency[];
|
|
30
|
+
identifier(): string;
|
|
31
|
+
readableIdentifier(): string;
|
|
32
|
+
nameForCondition(): string | undefined;
|
|
33
|
+
size(type?: string | null): number;
|
|
34
|
+
libIdent(options: JsLibIdentOptions): string | null;
|
|
82
35
|
}
|
|
83
36
|
|
|
84
37
|
export interface RspackError extends Error {
|
|
@@ -100,6 +53,12 @@ export interface JsSource {
|
|
|
100
53
|
map?: string
|
|
101
54
|
}
|
|
102
55
|
|
|
56
|
+
export type JsSourceFromJs =
|
|
57
|
+
| { kind: "raw"; content: string | Buffer; map?: string }
|
|
58
|
+
| { kind: "native"; handle: JsNativeSource }
|
|
59
|
+
| { kind: "concat"; children: JsSourceFromJs[] }
|
|
60
|
+
| { kind: "replace"; original: JsSourceFromJs; replacements: JsReplaceSourceEdit[]; fallback: () => JsSourceFromJs }
|
|
61
|
+
|
|
103
62
|
export type CompilerId = void;
|
|
104
63
|
/* -- banner.d.ts end -- */
|
|
105
64
|
|
|
@@ -111,6 +70,7 @@ export declare class ExternalObject<T> {
|
|
|
111
70
|
[K: symbol]: T
|
|
112
71
|
}
|
|
113
72
|
}
|
|
73
|
+
|
|
114
74
|
export declare class Assets {
|
|
115
75
|
keys(): Array<string>
|
|
116
76
|
}
|
|
@@ -187,30 +147,6 @@ export declare class CodeGenerationResults {
|
|
|
187
147
|
get(module: Module, runtime: string | string[] | undefined): CodeGenerationResult
|
|
188
148
|
}
|
|
189
149
|
|
|
190
|
-
export declare class ConcatenatedModule {
|
|
191
|
-
get rootModule(): Module
|
|
192
|
-
get modules(): Module[]
|
|
193
|
-
readableIdentifier(): string
|
|
194
|
-
_originalSource(): JsSource | undefined
|
|
195
|
-
nameForCondition(): string | undefined
|
|
196
|
-
get blocks(): AsyncDependenciesBlock[]
|
|
197
|
-
get dependencies(): Dependency[]
|
|
198
|
-
size(ty?: string | undefined | null): number
|
|
199
|
-
libIdent(options: JsLibIdentOptions): string | null
|
|
200
|
-
_emitFile(filename: string, source: JsSource, assetInfo?: AssetInfo | undefined | null): void
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
export declare class ContextModule {
|
|
204
|
-
readableIdentifier(): string
|
|
205
|
-
_originalSource(): JsSource | undefined
|
|
206
|
-
nameForCondition(): string | undefined
|
|
207
|
-
get blocks(): AsyncDependenciesBlock[]
|
|
208
|
-
get dependencies(): Dependency[]
|
|
209
|
-
size(ty?: string | undefined | null): number
|
|
210
|
-
libIdent(options: JsLibIdentOptions): string | null
|
|
211
|
-
_emitFile(filename: string, source: JsSource, assetInfo?: AssetInfo | undefined | null): void
|
|
212
|
-
}
|
|
213
|
-
|
|
214
150
|
export declare class Dependency {
|
|
215
151
|
get _parentModule(): Module | undefined
|
|
216
152
|
get type(): string
|
|
@@ -265,23 +201,34 @@ export declare class EntryOptionsDto {
|
|
|
265
201
|
}
|
|
266
202
|
export type EntryOptionsDTO = EntryOptionsDto
|
|
267
203
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
204
|
+
/** Native operations on the owning compiler's current dependency collection. */
|
|
205
|
+
export declare class FileSystemDependencies {
|
|
206
|
+
get added(): Array<string>
|
|
207
|
+
get removed(): Array<string>
|
|
208
|
+
size(): number
|
|
209
|
+
has(value: string): boolean
|
|
210
|
+
clear(): void
|
|
211
|
+
update(added: Array<string>, deleted: Array<string>): void
|
|
212
|
+
values(this: this): ReadonlyArray<string>
|
|
213
|
+
add(value: string): void
|
|
214
|
+
addAll(values: Array<string>): void
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/** One shared cache, initialized from the first compiler that uses it. */
|
|
218
|
+
export declare class JsCache {
|
|
219
|
+
constructor()
|
|
220
|
+
beginIdle(): void
|
|
221
|
+
endIdle(): void
|
|
222
|
+
shutdown(): Promise<void>
|
|
277
223
|
}
|
|
278
224
|
|
|
279
225
|
export declare class JsCompilation {
|
|
280
|
-
updateAsset(filename: string, newSourceOrFunction:
|
|
226
|
+
updateAsset(filename: string, newSourceOrFunction: JsSourceFromJs | ((source: JsSource) => JsSourceFromJs), assetInfoUpdateOrFunction?: AssetInfo | ((assetInfo: AssetInfo) => AssetInfo | undefined)): void
|
|
281
227
|
getAssets(): Readonly<JsAsset>[]
|
|
282
228
|
getAsset(name: string): JsAsset | null
|
|
283
229
|
getAssetSource(name: string): JsSource | null
|
|
284
|
-
|
|
230
|
+
getAssetNativeSource(name: string): JsNativeSource | null
|
|
231
|
+
get modules(): Modules
|
|
285
232
|
get builtModules(): Array<Module>
|
|
286
233
|
getOptimizationBailout(): Array<JsStatsOptimizationBailout>
|
|
287
234
|
get chunks(): Chunks
|
|
@@ -289,17 +236,20 @@ export declare class JsCompilation {
|
|
|
289
236
|
getNamedChunk(name: string): Chunk
|
|
290
237
|
getNamedChunkGroupKeys(): Array<string>
|
|
291
238
|
getNamedChunkGroup(name: string): ChunkGroup
|
|
292
|
-
setAssetSource(name: string, source:
|
|
239
|
+
setAssetSource(name: string, source: JsSourceFromJs): void
|
|
293
240
|
deleteAssetSource(name: string): void
|
|
294
241
|
getAssetFilenames(): Array<string>
|
|
295
242
|
hasAsset(name: string): boolean
|
|
296
|
-
emitAsset(filename: string, source:
|
|
243
|
+
emitAsset(filename: string, source: JsSourceFromJs, assetInfo?: AssetInfo | undefined | null): void
|
|
297
244
|
deleteAsset(filename: string): void
|
|
298
245
|
renameAsset(filename: string, newName: string): void
|
|
299
246
|
get entrypoints(): ChunkGroup[]
|
|
300
247
|
get chunkGroups(): ChunkGroup[]
|
|
301
248
|
get hash(): string | null
|
|
302
|
-
|
|
249
|
+
get fileDependencies(): FileSystemDependencies
|
|
250
|
+
get contextDependencies(): FileSystemDependencies
|
|
251
|
+
get missingDependencies(): FileSystemDependencies
|
|
252
|
+
get buildDependencies(): FileSystemDependencies
|
|
303
253
|
pushDiagnostic(diagnostic: JsRspackDiagnostic): void
|
|
304
254
|
pushNativeDiagnostic(diagnostic: ExternalObject<'Diagnostic'>): void
|
|
305
255
|
pushNativeDiagnostics(diagnostics: ExternalObject<'Diagnostic[]'>): void
|
|
@@ -334,7 +284,7 @@ export declare class JsCompilation {
|
|
|
334
284
|
}
|
|
335
285
|
|
|
336
286
|
export declare class JsCompiler {
|
|
337
|
-
constructor(compilerPath: string, options: RawOptions, builtinPlugins: BuiltinPlugin[], registerJsTaps: RegisterJsTaps, outputFilesystem: ThreadsafeNodeFS, intermediateFilesystem: ThreadsafeNodeFS | undefined | null, inputFilesystem: ThreadsafeNodeFS | undefined | null, resolverFactoryReference: JsResolverFactory, unsafeFastDrop: boolean, platform: RawCompilerPlatform, infrastructureLogCallback: (logs: JsLog[]) => void)
|
|
287
|
+
constructor(compilerPath: string, options: RawOptions, builtinPlugins: BuiltinPlugin[], registerJsTaps: RegisterJsTaps, outputFilesystem: ThreadsafeNodeFS, intermediateFilesystem: ThreadsafeNodeFS | undefined | null, inputFilesystem: ThreadsafeNodeFS | undefined | null, resolverFactoryReference: JsResolverFactory, unsafeFastDrop: boolean, platform: RawCompilerPlatform, infrastructureLogCallback: (logs: JsLog[]) => void, cache: JsCache, jsHelpers: JsHelpers)
|
|
338
288
|
setNonSkippableRegisters(kinds: Array<RegisterJsTapKind>): void
|
|
339
289
|
/** Build with the given option passed to the constructor */
|
|
340
290
|
build(callback: (err: null | Error) => void): void
|
|
@@ -374,21 +324,6 @@ export declare class JsCoordinator {
|
|
|
374
324
|
constructor()
|
|
375
325
|
}
|
|
376
326
|
|
|
377
|
-
export declare class JsDependencies {
|
|
378
|
-
get fileDependencies(): Array<string>
|
|
379
|
-
get addedFileDependencies(): Array<string>
|
|
380
|
-
get removedFileDependencies(): Array<string>
|
|
381
|
-
get contextDependencies(): Array<string>
|
|
382
|
-
get addedContextDependencies(): Array<string>
|
|
383
|
-
get removedContextDependencies(): Array<string>
|
|
384
|
-
get missingDependencies(): Array<string>
|
|
385
|
-
get addedMissingDependencies(): Array<string>
|
|
386
|
-
get removedMissingDependencies(): Array<string>
|
|
387
|
-
get buildDependencies(): Array<string>
|
|
388
|
-
get addedBuildDependencies(): Array<string>
|
|
389
|
-
get removedBuildDependencies(): Array<string>
|
|
390
|
-
}
|
|
391
|
-
|
|
392
327
|
export declare class JsEntries {
|
|
393
328
|
clear(): void
|
|
394
329
|
get size(): number
|
|
@@ -407,27 +342,31 @@ export declare class JsExportsInfo {
|
|
|
407
342
|
getUsed(name: string | string[], runtime: string | string[] | undefined): 0 | 1 | 2 | 3 | 4
|
|
408
343
|
}
|
|
409
344
|
|
|
410
|
-
export declare class JsLoaderCache {
|
|
411
|
-
get(loaderIndex: number, content: string | Uint8Array, existing: JsLoaderDependencies): Promise<JsLoaderCacheEntry | null>
|
|
412
|
-
store(loaderIndex: number, output: JsLoaderCacheEntry): Promise<void>
|
|
413
|
-
}
|
|
414
|
-
|
|
415
345
|
export declare class JsModuleGraph {
|
|
416
|
-
getModule(dependency: Dependency): Module | null
|
|
417
|
-
getResolvedModule(dependency: Dependency): Module | null
|
|
346
|
+
getModule(dependency: Dependency | EntryDependency): Module | null
|
|
347
|
+
getResolvedModule(dependency: Dependency | EntryDependency): Module | null
|
|
418
348
|
getUsedExports(module: Module, runtime: string | string[]): boolean | Array<string> | null
|
|
419
349
|
getProvidedExports(module: Module): true | string[] | null
|
|
420
350
|
getIssuer(module: Module): Module | null
|
|
421
351
|
getExportsInfo(module: Module): JsExportsInfo
|
|
422
|
-
getConnection(dependency: Dependency): ModuleGraphConnection | null
|
|
352
|
+
getConnection(dependency: Dependency | EntryDependency): ModuleGraphConnection | null
|
|
423
353
|
getOutgoingConnections(module: Module): ModuleGraphConnection[]
|
|
424
354
|
getOutgoingConnectionsInOrder(module: Module): ModuleGraphConnection[]
|
|
425
355
|
getIncomingConnections(module: Module): ModuleGraphConnection[]
|
|
426
|
-
getParentModule(dependency: Dependency): Module | null
|
|
427
|
-
getParentBlockIndex(dependency: Dependency): number
|
|
356
|
+
getParentModule(dependency: Dependency | EntryDependency): Module | null
|
|
357
|
+
getParentBlockIndex(dependency: Dependency | EntryDependency): number
|
|
428
358
|
isAsync(module: Module): boolean
|
|
429
359
|
}
|
|
430
360
|
|
|
361
|
+
/**
|
|
362
|
+
* An owned source reference transferred from the compiler to JavaScript.
|
|
363
|
+
*
|
|
364
|
+
* JavaScript uses this as an opaque handle when updating an existing asset.
|
|
365
|
+
*/
|
|
366
|
+
export declare class JsNativeSource {
|
|
367
|
+
static fromSource(source: JsSourceFromJs): JsNativeSource
|
|
368
|
+
}
|
|
369
|
+
|
|
431
370
|
export declare class JsResolver {
|
|
432
371
|
resolveSync(path: string, request: string): string | undefined
|
|
433
372
|
resolve(path: string, request: string, callback: (err: null | Error, req?: string) => void): void
|
|
@@ -443,20 +382,7 @@ export declare class JsStats {
|
|
|
443
382
|
getLogging(acceptedTypes: number): Array<JsLog>
|
|
444
383
|
}
|
|
445
384
|
|
|
446
|
-
export declare class KnownBuildInfo {
|
|
447
|
-
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
export declare class Module {
|
|
451
|
-
readableIdentifier(): string
|
|
452
|
-
_originalSource(): JsSource | undefined
|
|
453
|
-
nameForCondition(): string | undefined
|
|
454
|
-
get blocks(): AsyncDependenciesBlock[]
|
|
455
|
-
get dependencies(): Dependency[]
|
|
456
|
-
size(ty?: string | undefined | null): number
|
|
457
|
-
libIdent(options: JsLibIdentOptions): string | null
|
|
458
|
-
_emitFile(filename: string, source: JsSource, assetInfo?: AssetInfo | undefined | null): void
|
|
459
|
-
}
|
|
385
|
+
export declare class KnownBuildInfo {}
|
|
460
386
|
|
|
461
387
|
export declare class ModuleGraphConnection {
|
|
462
388
|
get dependency(): Dependency
|
|
@@ -466,11 +392,37 @@ export declare class ModuleGraphConnection {
|
|
|
466
392
|
getActiveState(runtime: string | string[] | undefined): ConnectionState
|
|
467
393
|
}
|
|
468
394
|
|
|
395
|
+
/** Read-only operations on a compilation's module collection. */
|
|
396
|
+
export declare class Modules {
|
|
397
|
+
size(): number
|
|
398
|
+
has(value: Module): boolean
|
|
399
|
+
values(): ReadonlyArray<Module>
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
/** Owns the timestamp snapshot so either table can be converted after the watcher closes. */
|
|
403
|
+
export declare class NativeTimeInfoEntries {
|
|
404
|
+
get fileTimestamps(): NativeTimeInfoTable
|
|
405
|
+
get directoryTimestamps(): NativeTimeInfoTable
|
|
406
|
+
}
|
|
407
|
+
|
|
469
408
|
export declare class NativeWatcher {
|
|
470
409
|
constructor(options: NativeWatcherOptions)
|
|
471
410
|
watch(files: [Array<string>, Array<string>], directories: [Array<string>, Array<string>], missing: [Array<string>, Array<string>], startTime: bigint, callback: (err: Error | null, result: NativeWatchResult) => void, callbackUndelayed: (event: NativeWatchUndelayedEvent) => void): void
|
|
472
411
|
triggerEvent(kind: 'change' | 'remove' | 'create', path: string): void
|
|
473
412
|
close(): Promise<void>
|
|
413
|
+
/**
|
|
414
|
+
* watchpack's `aggregatedChanges` / `aggregatedRemovals`: the events that
|
|
415
|
+
* arrived since the last aggregated batch (while paused), read without
|
|
416
|
+
* draining them.
|
|
417
|
+
*/
|
|
418
|
+
peekAggregated(): NativeWatchResult
|
|
419
|
+
/**
|
|
420
|
+
* watchpack's `getAggregated`: the same events, drained, for the build
|
|
421
|
+
* that folds them in.
|
|
422
|
+
*/
|
|
423
|
+
getAggregated(): NativeWatchResult
|
|
424
|
+
/** watchpack's `collectTimeInfoEntries`, over every registered path. */
|
|
425
|
+
collectTimeInfoEntries(): NativeTimeInfoEntries
|
|
474
426
|
pause(): void
|
|
475
427
|
}
|
|
476
428
|
|
|
@@ -479,7 +431,6 @@ export declare class NativeWatchResult {
|
|
|
479
431
|
removedFiles: Array<string>
|
|
480
432
|
}
|
|
481
433
|
|
|
482
|
-
|
|
483
434
|
export declare class RawExternalItemFnCtx {
|
|
484
435
|
data(): RawExternalItemFnCtxData
|
|
485
436
|
getResolve(options?: RawResolveOptionsWithDependencyType | undefined | null): (context: string, path: string, callback: (error?: Error, text?: string) => void) => void
|
|
@@ -582,6 +533,7 @@ export declare enum BuiltinPluginName {
|
|
|
582
533
|
RuntimePlugin = 'RuntimePlugin',
|
|
583
534
|
JsonModulesPlugin = 'JsonModulesPlugin',
|
|
584
535
|
InferAsyncModulesPlugin = 'InferAsyncModulesPlugin',
|
|
536
|
+
ImportedByDeferModulesPlugin = 'ImportedByDeferModulesPlugin',
|
|
585
537
|
JavascriptModulesPlugin = 'JavascriptModulesPlugin',
|
|
586
538
|
AsyncWebAssemblyModulesPlugin = 'AsyncWebAssemblyModulesPlugin',
|
|
587
539
|
AssetModulesPlugin = 'AssetModulesPlugin',
|
|
@@ -627,11 +579,15 @@ export declare enum BuiltinPluginName {
|
|
|
627
579
|
HttpUriPlugin = 'HttpUriPlugin',
|
|
628
580
|
CssChunkingPlugin = 'CssChunkingPlugin',
|
|
629
581
|
RscServerPlugin = 'RscServerPlugin',
|
|
630
|
-
RscClientPlugin = 'RscClientPlugin'
|
|
582
|
+
RscClientPlugin = 'RscClientPlugin',
|
|
631
583
|
}
|
|
632
584
|
|
|
633
585
|
export declare function cleanupGlobalTrace(): void
|
|
634
586
|
|
|
587
|
+
export declare function concatenatedModuleGetModules(module: Module): Module[]
|
|
588
|
+
|
|
589
|
+
export declare function concatenatedModuleGetRootModule(module: Module): Module
|
|
590
|
+
|
|
635
591
|
export interface ContextInfo {
|
|
636
592
|
issuer: string
|
|
637
593
|
issuerLayer?: string
|
|
@@ -640,14 +596,16 @@ export interface ContextInfo {
|
|
|
640
596
|
export declare enum EnforceExtension {
|
|
641
597
|
Auto = 0,
|
|
642
598
|
Enabled = 1,
|
|
643
|
-
Disabled = 2
|
|
599
|
+
Disabled = 2,
|
|
644
600
|
}
|
|
645
601
|
|
|
646
602
|
/**
|
|
647
603
|
* Expected version of @rspack/core to the current binding version
|
|
648
604
|
* @internal
|
|
649
605
|
*/
|
|
650
|
-
export const EXPECTED_RSPACK_CORE_VERSION: string
|
|
606
|
+
export declare const EXPECTED_RSPACK_CORE_VERSION: string
|
|
607
|
+
|
|
608
|
+
export declare function externalModuleGetUserRequest(module: Module): string
|
|
651
609
|
|
|
652
610
|
export declare function formatDiagnostic(diagnostic: JsDiagnostic): ExternalObject<'Diagnostic'>
|
|
653
611
|
|
|
@@ -877,13 +835,19 @@ export interface JsExecuteModuleResult {
|
|
|
877
835
|
missingDependencies: Array<string>
|
|
878
836
|
cacheable: boolean
|
|
879
837
|
id: number
|
|
880
|
-
|
|
838
|
+
errors: Array<RspackError>
|
|
881
839
|
}
|
|
882
840
|
|
|
883
841
|
export interface JsFactoryMeta {
|
|
884
842
|
sideEffectFree?: boolean
|
|
885
843
|
}
|
|
886
844
|
|
|
845
|
+
export interface JsHelpers {
|
|
846
|
+
createModule: (kind: ModuleKind) => Module
|
|
847
|
+
applyIndexedArrayUpdates: <T>(source: ReadonlyArray<T>, target: T[], commands: Uint32Array) => void
|
|
848
|
+
swapRemoveArrayElements: <T>(array: T[], removedIndices: Uint32Array) => void
|
|
849
|
+
}
|
|
850
|
+
|
|
887
851
|
export interface JsHtmlPluginAssets {
|
|
888
852
|
publicPath: string
|
|
889
853
|
js: Array<string>
|
|
@@ -956,34 +920,26 @@ export interface JsLinkPreloadData {
|
|
|
956
920
|
chunk: Chunk
|
|
957
921
|
}
|
|
958
922
|
|
|
959
|
-
export interface JsLoaderCacheEntry {
|
|
960
|
-
content: null | string | Uint8Array
|
|
961
|
-
sourceMap?: Uint8Array
|
|
962
|
-
addedDependencies: JsLoaderDependencies
|
|
963
|
-
removedDependencies: JsLoaderDependencies
|
|
964
|
-
}
|
|
965
|
-
|
|
966
923
|
export interface JsLoaderContext {
|
|
967
924
|
resource: string
|
|
968
925
|
_module: Module
|
|
969
926
|
hot: Readonly<boolean>
|
|
970
927
|
/** Content maybe empty in pitching stage */
|
|
971
|
-
content:
|
|
928
|
+
content: string | Buffer | null
|
|
972
929
|
additionalData?: any
|
|
973
930
|
__internal__parseMeta: Record<string, string>
|
|
974
931
|
sourceMap?: Buffer
|
|
975
932
|
cacheable: boolean
|
|
976
933
|
dependencies: JsLoaderDependencies
|
|
934
|
+
addedDependencies: JsLoaderDependencies
|
|
935
|
+
removedDependencies: JsLoaderDependencies
|
|
977
936
|
loaderItems: Array<JsLoaderItem>
|
|
978
937
|
loaderIndex: number
|
|
979
938
|
loaderState: Readonly<JsLoaderState>
|
|
939
|
+
loaderChainStart: number
|
|
940
|
+
loaderChainEnd: number
|
|
980
941
|
__internal__error?: RspackError
|
|
981
|
-
|
|
982
|
-
/**
|
|
983
|
-
* UTF-8 hint for `content`
|
|
984
|
-
* - Some(true): `content` is a `UTF-8` encoded sequence
|
|
985
|
-
*/
|
|
986
|
-
__internal__utf8Hint?: boolean
|
|
942
|
+
__internal__diagnostics?: Array<JsRspackDiagnostic>
|
|
987
943
|
}
|
|
988
944
|
|
|
989
945
|
export interface JsLoaderDependencies {
|
|
@@ -1000,12 +956,14 @@ export interface JsLoaderItem {
|
|
|
1000
956
|
data: any
|
|
1001
957
|
normalExecuted: boolean
|
|
1002
958
|
pitchExecuted: boolean
|
|
959
|
+
codeFilter?: string | RegExp
|
|
960
|
+
filterMatched: boolean
|
|
1003
961
|
noPitch: boolean
|
|
1004
962
|
}
|
|
1005
963
|
|
|
1006
964
|
export declare enum JsLoaderState {
|
|
1007
965
|
Pitching = 'Pitching',
|
|
1008
|
-
Normal = 'Normal'
|
|
966
|
+
Normal = 'Normal',
|
|
1009
967
|
}
|
|
1010
968
|
|
|
1011
969
|
export interface JsLog {
|
|
@@ -1060,13 +1018,19 @@ export interface JsRealContentHashPluginUpdateHashData {
|
|
|
1060
1018
|
oldHash: string
|
|
1061
1019
|
}
|
|
1062
1020
|
|
|
1021
|
+
export interface JsReplaceSourceEdit {
|
|
1022
|
+
start: number
|
|
1023
|
+
end: number
|
|
1024
|
+
content: string
|
|
1025
|
+
name?: string
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1063
1028
|
export interface JsResolveData {
|
|
1064
1029
|
request: string
|
|
1065
1030
|
context: string
|
|
1066
1031
|
contextInfo: ContextInfo
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
missingDependencies: Array<string>
|
|
1032
|
+
/** The import attributes of the dependency that triggered this resolution, read-only. */
|
|
1033
|
+
attributes?: Record<string, string>
|
|
1070
1034
|
createData?: JsCreateData
|
|
1071
1035
|
}
|
|
1072
1036
|
|
|
@@ -1309,7 +1273,7 @@ export interface JsRspackDiagnostic {
|
|
|
1309
1273
|
|
|
1310
1274
|
export declare enum JsRspackSeverity {
|
|
1311
1275
|
Error = 'Error',
|
|
1312
|
-
Warn = 'Warn'
|
|
1276
|
+
Warn = 'Warn',
|
|
1313
1277
|
}
|
|
1314
1278
|
|
|
1315
1279
|
export interface JsRuntimeGlobals {
|
|
@@ -1340,21 +1304,14 @@ export interface JsRuntimeRequirementInTreeResult {
|
|
|
1340
1304
|
allRuntimeRequirements: JsRuntimeGlobals
|
|
1341
1305
|
}
|
|
1342
1306
|
|
|
1343
|
-
|
|
1344
|
-
* Zero copy `JsSourceFromJs` slice shared between Rust and Node.js if buffer is used.
|
|
1345
|
-
*
|
|
1346
|
-
* It can only be used in non-async context and the lifetime is bound to the fn closure.
|
|
1347
|
-
*
|
|
1348
|
-
* If you want to use Node.js Buffer in async context or want to extend the lifetime, use `JsSourceToJs` instead.
|
|
1349
|
-
*/
|
|
1350
|
-
export interface JsSourceFromJs {
|
|
1307
|
+
export interface JsSourceToJs {
|
|
1351
1308
|
source: string | Buffer
|
|
1352
1309
|
map?: string
|
|
1353
1310
|
}
|
|
1354
1311
|
|
|
1355
|
-
export interface
|
|
1312
|
+
export interface JsSourceWithLazyMap {
|
|
1356
1313
|
source: string | Buffer
|
|
1357
|
-
map?: string
|
|
1314
|
+
map?: string | (() => string)
|
|
1358
1315
|
}
|
|
1359
1316
|
|
|
1360
1317
|
export interface JsStatsAsset {
|
|
@@ -1396,6 +1353,13 @@ export interface JsStatsAssetsByChunkName {
|
|
|
1396
1353
|
files: Array<string>
|
|
1397
1354
|
}
|
|
1398
1355
|
|
|
1356
|
+
export interface JsStatsCacheInfo {
|
|
1357
|
+
hits: number
|
|
1358
|
+
misses: number
|
|
1359
|
+
reused: number
|
|
1360
|
+
stores: number
|
|
1361
|
+
}
|
|
1362
|
+
|
|
1399
1363
|
export interface JsStatsChildGroupChildAssets {
|
|
1400
1364
|
preload?: Array<string>
|
|
1401
1365
|
prefetch?: Array<string>
|
|
@@ -1449,6 +1413,7 @@ export interface JsStatsChunkGroupChildren {
|
|
|
1449
1413
|
export interface JsStatsCompilation {
|
|
1450
1414
|
assets?: Array<JsStatsAsset>
|
|
1451
1415
|
assetsByChunkName?: Array<JsStatsAssetsByChunkName>
|
|
1416
|
+
cacheInfo?: Record<string, JsStatsCacheInfo>
|
|
1452
1417
|
chunks?: Array<JsStatsChunk>
|
|
1453
1418
|
entrypoints?: Array<JsStatsChunkGroup>
|
|
1454
1419
|
errors: Array<JsStatsError>
|
|
@@ -1557,6 +1522,7 @@ export interface JsStatsOptimizationBailout {
|
|
|
1557
1522
|
|
|
1558
1523
|
export interface JsStatsOptions {
|
|
1559
1524
|
assets: boolean
|
|
1525
|
+
cacheInfo: boolean
|
|
1560
1526
|
cachedModules: boolean
|
|
1561
1527
|
chunks: boolean
|
|
1562
1528
|
chunkGroupAuxiliary: boolean
|
|
@@ -1638,6 +1604,51 @@ export declare function minify(source: string, options: string): Promise<Transfo
|
|
|
1638
1604
|
|
|
1639
1605
|
export declare function minifySync(source: string, options: string): TransformOutput
|
|
1640
1606
|
|
|
1607
|
+
export declare function moduleEmitFile(module: Module, filename: string, source: JsSourceFromJs, assetInfo?: AssetInfo | null): void
|
|
1608
|
+
|
|
1609
|
+
export declare function moduleGetBlocks(module: Module): AsyncDependenciesBlock[]
|
|
1610
|
+
|
|
1611
|
+
export declare function moduleGetBuildInfo(module: Module): BuildInfo
|
|
1612
|
+
|
|
1613
|
+
export declare function moduleGetContext(module: Module): string | undefined
|
|
1614
|
+
|
|
1615
|
+
export declare function moduleGetDependencies(module: Module): Dependency[]
|
|
1616
|
+
|
|
1617
|
+
export declare function moduleGetFactoryMeta(module: Module): JsFactoryMeta
|
|
1618
|
+
|
|
1619
|
+
export declare function moduleGetIdentifier(module: Module): string
|
|
1620
|
+
|
|
1621
|
+
export declare function moduleGetLayer(module: Module): string | undefined
|
|
1622
|
+
|
|
1623
|
+
export declare function moduleGetNameForCondition(module: Module): string | undefined
|
|
1624
|
+
|
|
1625
|
+
export declare function moduleGetOriginalSource(module: Module): JsSourceWithLazyMap | undefined
|
|
1626
|
+
|
|
1627
|
+
export declare function moduleGetReadableIdentifier(module: Module): string
|
|
1628
|
+
|
|
1629
|
+
export declare function moduleGetType(module: Module): string
|
|
1630
|
+
|
|
1631
|
+
export declare function moduleGetUseSimpleSourceMap(module: Module): boolean
|
|
1632
|
+
|
|
1633
|
+
export declare function moduleGetUseSourceMap(module: Module): boolean
|
|
1634
|
+
|
|
1635
|
+
/** JavaScript class selected when wrapping a native module. */
|
|
1636
|
+
export declare enum ModuleKind {
|
|
1637
|
+
Module = 0,
|
|
1638
|
+
Normal = 1,
|
|
1639
|
+
Concatenated = 2,
|
|
1640
|
+
Context = 3,
|
|
1641
|
+
External = 4,
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1644
|
+
export declare function moduleLibIdent(module: Module, options: JsLibIdentOptions): string | null
|
|
1645
|
+
|
|
1646
|
+
export declare function moduleSetBuildInfo(module: Module, value: BuildInfo): void
|
|
1647
|
+
|
|
1648
|
+
export declare function moduleSetFactoryMeta(module: Module, factoryMeta: JsFactoryMeta): void
|
|
1649
|
+
|
|
1650
|
+
export declare function moduleSize(module: Module, ty?: string | null): number
|
|
1651
|
+
|
|
1641
1652
|
/**
|
|
1642
1653
|
* Module Resolution Options
|
|
1643
1654
|
*
|
|
@@ -1810,15 +1821,34 @@ export interface NapiResolveOptions {
|
|
|
1810
1821
|
enablePnp?: boolean
|
|
1811
1822
|
}
|
|
1812
1823
|
|
|
1824
|
+
/**
|
|
1825
|
+
* One row of watchpack's `TimeInfoEntries`, flattened for napi: a file's
|
|
1826
|
+
* `Entry` carries all three times, a directory's `OnlySafeTimeEntry` only
|
|
1827
|
+
* `safe_time`, and an `ExistenceOnlyTimeEntry` sets `existence_only`.
|
|
1828
|
+
*/
|
|
1829
|
+
export interface NativeTimeInfoEntry {
|
|
1830
|
+
path: string
|
|
1831
|
+
existenceOnly: boolean
|
|
1832
|
+
safeTime?: number
|
|
1833
|
+
timestamp?: number
|
|
1834
|
+
accuracy?: number
|
|
1835
|
+
}
|
|
1836
|
+
|
|
1837
|
+
export interface NativeTimeInfoTable {
|
|
1838
|
+
entries: Array<NativeTimeInfoEntry>
|
|
1839
|
+
missing: Array<string>
|
|
1840
|
+
}
|
|
1841
|
+
|
|
1813
1842
|
export interface NativeWatcherOptions {
|
|
1814
1843
|
followSymlinks?: boolean
|
|
1815
1844
|
pollInterval?: number
|
|
1816
1845
|
aggregateTimeout?: number
|
|
1817
1846
|
/**
|
|
1818
1847
|
* The ignored paths for the watcher.
|
|
1819
|
-
* It can be a single path, an array
|
|
1848
|
+
* It can be a single path, a regular expression, an array mixing paths and
|
|
1849
|
+
* regular expressions, or a predicate returning `true` for entries to ignore.
|
|
1820
1850
|
*/
|
|
1821
|
-
ignored?: string | string[] |
|
|
1851
|
+
ignored?: string | RegExp | (string | RegExp)[] | ((entry: string) => boolean)
|
|
1822
1852
|
}
|
|
1823
1853
|
|
|
1824
1854
|
/**
|
|
@@ -1829,6 +1859,7 @@ export interface NativeWatcherOptions {
|
|
|
1829
1859
|
export interface NativeWatchUndelayedEvent {
|
|
1830
1860
|
kind: string
|
|
1831
1861
|
path: string
|
|
1862
|
+
mtime?: null
|
|
1832
1863
|
}
|
|
1833
1864
|
|
|
1834
1865
|
export interface NodeFsStats {
|
|
@@ -1843,6 +1874,24 @@ export interface NodeFsStats {
|
|
|
1843
1874
|
mode: number
|
|
1844
1875
|
}
|
|
1845
1876
|
|
|
1877
|
+
export declare function normalModuleGetError(module: Module): RspackError | undefined
|
|
1878
|
+
|
|
1879
|
+
export declare function normalModuleGetLoaders(module: Module): Array<JsLoaderItem>
|
|
1880
|
+
|
|
1881
|
+
export declare function normalModuleGetMatchResource(module: Module): string | undefined
|
|
1882
|
+
|
|
1883
|
+
export declare function normalModuleGetRawRequest(module: Module): string
|
|
1884
|
+
|
|
1885
|
+
export declare function normalModuleGetRequest(module: Module): string
|
|
1886
|
+
|
|
1887
|
+
export declare function normalModuleGetResource(module: Module): string
|
|
1888
|
+
|
|
1889
|
+
export declare function normalModuleGetResourceResolveData(module: Module): Readonly<JsResourceData>
|
|
1890
|
+
|
|
1891
|
+
export declare function normalModuleGetUserRequest(module: Module): string
|
|
1892
|
+
|
|
1893
|
+
export declare function normalModuleSetMatchResource(module: Module, value: string | undefined): void
|
|
1894
|
+
|
|
1846
1895
|
export interface PathWithInfo {
|
|
1847
1896
|
path: string
|
|
1848
1897
|
info: AssetInfo
|
|
@@ -1932,6 +1981,7 @@ export interface RawCacheGroupOptions {
|
|
|
1932
1981
|
minSize?: number | RawSplitChunkSizes
|
|
1933
1982
|
minSizeReduction?: number | RawSplitChunkSizes
|
|
1934
1983
|
enforceSizeThreshold?: number | RawSplitChunkSizes
|
|
1984
|
+
minRemainingSize?: number | RawSplitChunkSizes
|
|
1935
1985
|
maxSize?: number | RawSplitChunkSizes
|
|
1936
1986
|
maxAsyncSize?: number | RawSplitChunkSizes
|
|
1937
1987
|
maxInitialSize?: number | RawSplitChunkSizes
|
|
@@ -1946,14 +1996,13 @@ export interface RawCacheGroupOptions {
|
|
|
1946
1996
|
|
|
1947
1997
|
export interface RawCacheOptionsMemory {
|
|
1948
1998
|
maxGenerations?: number
|
|
1949
|
-
snapshot?: RawSnapshotOptions
|
|
1950
1999
|
}
|
|
1951
2000
|
|
|
1952
2001
|
export interface RawCacheOptionsPersistent {
|
|
1953
2002
|
buildDependencies?: Array<string>
|
|
1954
2003
|
version?: string
|
|
1955
2004
|
maxAge: number
|
|
1956
|
-
|
|
2005
|
+
maxMemoryGenerations?: number
|
|
1957
2006
|
storage?: RawStorageOptions
|
|
1958
2007
|
portable?: boolean
|
|
1959
2008
|
readonly?: boolean
|
|
@@ -2187,6 +2236,7 @@ export interface RawCssExtractPluginOption {
|
|
|
2187
2236
|
|
|
2188
2237
|
export interface RawCssGeneratorOptions {
|
|
2189
2238
|
exportsOnly?: boolean
|
|
2239
|
+
runtimePublicPath?: boolean
|
|
2190
2240
|
esModule?: boolean
|
|
2191
2241
|
}
|
|
2192
2242
|
|
|
@@ -2201,6 +2251,7 @@ export interface RawCssImportContext {
|
|
|
2201
2251
|
export interface RawCssModuleGeneratorOptions {
|
|
2202
2252
|
exportsConvention?: "as-is" | "camel-case" | "camel-case-only" | "dashes" | "dashes-only"
|
|
2203
2253
|
exportsOnly?: boolean
|
|
2254
|
+
runtimePublicPath?: boolean
|
|
2204
2255
|
localIdentHashDigest?: string
|
|
2205
2256
|
localIdentHashDigestLength?: number
|
|
2206
2257
|
localIdentHashFunction?: string
|
|
@@ -2308,6 +2359,7 @@ export interface RawEnvironment {
|
|
|
2308
2359
|
templateLiteral: boolean
|
|
2309
2360
|
dynamicImportInWorker: boolean
|
|
2310
2361
|
importMetaDirnameAndFilename: boolean
|
|
2362
|
+
topLevelAwait: boolean
|
|
2311
2363
|
}
|
|
2312
2364
|
|
|
2313
2365
|
export interface RawEsmLibraryPlugin {
|
|
@@ -2349,10 +2401,15 @@ export interface RawExternalItemFnResult {
|
|
|
2349
2401
|
result?: string | boolean | string[] | Record<string, string[]>
|
|
2350
2402
|
}
|
|
2351
2403
|
|
|
2404
|
+
export interface RawExternalItemObject {
|
|
2405
|
+
values: Record<string, string | boolean | string[] | Record<string, string[]>>
|
|
2406
|
+
byLayer?: Record<string, Record<string, string | boolean | string[] | Record<string, string[]>>>
|
|
2407
|
+
}
|
|
2408
|
+
|
|
2352
2409
|
export interface RawExternalsPluginOptions {
|
|
2353
2410
|
type: string
|
|
2354
2411
|
fallbackType?: string
|
|
2355
|
-
externals: (string | RegExp |
|
|
2412
|
+
externals: (string | RegExp | RawExternalItemObject | ((...args: any[]) => any))[]
|
|
2356
2413
|
placeInInitial: boolean
|
|
2357
2414
|
}
|
|
2358
2415
|
|
|
@@ -2453,6 +2510,7 @@ export interface RawHttpUriPluginOptions {
|
|
|
2453
2510
|
lockfileLocation?: string
|
|
2454
2511
|
cacheLocation?: string
|
|
2455
2512
|
upgrade: boolean
|
|
2513
|
+
frozen: boolean
|
|
2456
2514
|
httpClient: (url: string, headers: Record<string, string>) => Promise<JsHttpResponseRaw>
|
|
2457
2515
|
}
|
|
2458
2516
|
|
|
@@ -2505,7 +2563,7 @@ export interface RawIntegrityItem {
|
|
|
2505
2563
|
}
|
|
2506
2564
|
|
|
2507
2565
|
export declare enum RawJavascriptParserCommonjsExports {
|
|
2508
|
-
SkipInEsm = 'skipInEsm'
|
|
2566
|
+
SkipInEsm = 'skipInEsm',
|
|
2509
2567
|
}
|
|
2510
2568
|
|
|
2511
2569
|
export interface RawJavascriptParserCommonjsOptions {
|
|
@@ -2514,6 +2572,7 @@ export interface RawJavascriptParserCommonjsOptions {
|
|
|
2514
2572
|
|
|
2515
2573
|
export interface RawJavascriptParserOptions {
|
|
2516
2574
|
dynamicImportMode?: string
|
|
2575
|
+
dynamicUrl?: boolean
|
|
2517
2576
|
dynamicImportPreload?: string
|
|
2518
2577
|
dynamicImportPrefetch?: string
|
|
2519
2578
|
dynamicImportFetchPriority?: string
|
|
@@ -2531,55 +2590,55 @@ export interface RawJavascriptParserOptions {
|
|
|
2531
2590
|
importMeta?: string | Record<string, boolean>
|
|
2532
2591
|
commonjsMagicComments?: boolean
|
|
2533
2592
|
createRequire?: boolean | string
|
|
2534
|
-
commonjs?: boolean | { exports?: boolean | 'skipInEsm' }
|
|
2535
|
-
deferImport?: boolean
|
|
2536
|
-
sourceImport?: boolean
|
|
2537
|
-
/**
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
requireAlias?: boolean
|
|
2542
|
-
/**
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
requireAsExpression?: boolean
|
|
2547
|
-
/**
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
requireDynamic?: boolean
|
|
2552
|
-
/**
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
requireResolve?: boolean
|
|
2557
|
-
/**
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
importDynamic?: boolean
|
|
2562
|
-
/**
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
typeReexportsPresence?: string
|
|
2567
|
-
/**
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
jsx?: boolean
|
|
2572
|
-
/**
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
importMetaResolve?: boolean
|
|
2577
|
-
/**
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
pureFunctions?: Array<string>
|
|
2593
|
+
commonjs?: boolean | { exports?: boolean | 'skipInEsm' }
|
|
2594
|
+
deferImport?: boolean
|
|
2595
|
+
sourceImport?: boolean
|
|
2596
|
+
/**
|
|
2597
|
+
* This option is experimental in Rspack only and subject to change or be removed anytime.
|
|
2598
|
+
* @experimental
|
|
2599
|
+
*/
|
|
2600
|
+
requireAlias?: boolean
|
|
2601
|
+
/**
|
|
2602
|
+
* This option is experimental in Rspack only and subject to change or be removed anytime.
|
|
2603
|
+
* @experimental
|
|
2604
|
+
*/
|
|
2605
|
+
requireAsExpression?: boolean
|
|
2606
|
+
/**
|
|
2607
|
+
* This option is experimental in Rspack only and subject to change or be removed anytime.
|
|
2608
|
+
* @experimental
|
|
2609
|
+
*/
|
|
2610
|
+
requireDynamic?: boolean
|
|
2611
|
+
/**
|
|
2612
|
+
* This option is experimental in Rspack only and subject to change or be removed anytime.
|
|
2613
|
+
* @experimental
|
|
2614
|
+
*/
|
|
2615
|
+
requireResolve?: boolean
|
|
2616
|
+
/**
|
|
2617
|
+
* This option is experimental in Rspack only and subject to change or be removed anytime.
|
|
2618
|
+
* @experimental
|
|
2619
|
+
*/
|
|
2620
|
+
importDynamic?: boolean
|
|
2621
|
+
/**
|
|
2622
|
+
* This option is experimental in Rspack only and subject to change or be removed anytime.
|
|
2623
|
+
* @experimental
|
|
2624
|
+
*/
|
|
2625
|
+
typeReexportsPresence?: string
|
|
2626
|
+
/**
|
|
2627
|
+
* This option is experimental in Rspack only and subject to change or be removed anytime.
|
|
2628
|
+
* @experimental
|
|
2629
|
+
*/
|
|
2630
|
+
jsx?: boolean
|
|
2631
|
+
/**
|
|
2632
|
+
* This option is experimental in Rspack only and subject to change or be removed anytime.
|
|
2633
|
+
* @experimental
|
|
2634
|
+
*/
|
|
2635
|
+
importMetaResolve?: boolean
|
|
2636
|
+
/**
|
|
2637
|
+
* Flag top-level exported functions as side-effect-free for pure-function-based tree shaking.
|
|
2638
|
+
* This option is experimental in Rspack only and subject to change or be removed anytime.
|
|
2639
|
+
* @experimental
|
|
2640
|
+
*/
|
|
2641
|
+
pureFunctions?: Array<string>
|
|
2583
2642
|
}
|
|
2584
2643
|
|
|
2585
2644
|
export interface RawJavascriptParserWorkerOptions {
|
|
@@ -2597,12 +2656,12 @@ export interface RawJsonParserOptions {
|
|
|
2597
2656
|
}
|
|
2598
2657
|
|
|
2599
2658
|
export interface RawLazyCompilationOption {
|
|
2600
|
-
|
|
2659
|
+
takeNewlyActiveModules: ((err: Error | null) => Set<string>)
|
|
2601
2660
|
test?: RawLazyCompilationTest
|
|
2602
2661
|
entries: boolean
|
|
2603
2662
|
imports: boolean
|
|
2604
2663
|
client: string
|
|
2605
|
-
|
|
2664
|
+
collectReservedExternals: (layer?: string | null) => string[]
|
|
2606
2665
|
}
|
|
2607
2666
|
|
|
2608
2667
|
export interface RawLibManifestPluginOptions {
|
|
@@ -2722,6 +2781,7 @@ export interface RawModuleOptions {
|
|
|
2722
2781
|
}
|
|
2723
2782
|
|
|
2724
2783
|
export interface RawModuleRule {
|
|
2784
|
+
as?: string
|
|
2725
2785
|
/**
|
|
2726
2786
|
* A conditional match matching an absolute path + query + fragment.
|
|
2727
2787
|
* Note:
|
|
@@ -2775,13 +2835,16 @@ export interface RawModuleRuleUse {
|
|
|
2775
2835
|
options?: string
|
|
2776
2836
|
cache: boolean
|
|
2777
2837
|
optionsCacheKey: string
|
|
2838
|
+
codeFilter?: string | RegExp
|
|
2778
2839
|
}
|
|
2779
2840
|
|
|
2780
2841
|
export interface RawNewCache {
|
|
2781
2842
|
codeGeneration: boolean
|
|
2843
|
+
module: boolean
|
|
2782
2844
|
devtool: boolean
|
|
2783
2845
|
loader: boolean
|
|
2784
2846
|
minimize: boolean
|
|
2847
|
+
resolver: boolean
|
|
2785
2848
|
}
|
|
2786
2849
|
|
|
2787
2850
|
export interface RawNodeOption {
|
|
@@ -2831,14 +2894,15 @@ export interface RawOptions {
|
|
|
2831
2894
|
module: RawModuleOptions
|
|
2832
2895
|
optimization: RawOptimizationOptions
|
|
2833
2896
|
stats: RawStatsOptions
|
|
2834
|
-
cache: boolean | { type: "memory"
|
|
2897
|
+
cache: boolean | { type: "memory" } | ({ type: "persistent" } & RawCacheOptionsPersistent)
|
|
2898
|
+
snapshot: RawSnapshotOptions
|
|
2835
2899
|
experiments: RawExperiments
|
|
2836
|
-
incremental?: false | { [key: string]: boolean }
|
|
2837
|
-
node?: RawNodeOption
|
|
2838
|
-
amd?: string
|
|
2839
|
-
bail: boolean
|
|
2840
|
-
__references: Record<string, any>
|
|
2841
|
-
__virtual_files?: Array<JsVirtualFile>
|
|
2900
|
+
incremental?: false | { [key: string]: boolean }
|
|
2901
|
+
node?: RawNodeOption
|
|
2902
|
+
amd?: string
|
|
2903
|
+
bail: boolean
|
|
2904
|
+
__references: Record<string, any>
|
|
2905
|
+
__virtual_files?: Array<JsVirtualFile>
|
|
2842
2906
|
}
|
|
2843
2907
|
|
|
2844
2908
|
export interface RawOutputOptions {
|
|
@@ -2869,6 +2933,7 @@ export interface RawOutputOptions {
|
|
|
2869
2933
|
importMetaName: string
|
|
2870
2934
|
iife: boolean
|
|
2871
2935
|
module: boolean
|
|
2936
|
+
chunkFormat: string | false
|
|
2872
2937
|
chunkLoading: string | false
|
|
2873
2938
|
chunkLoadTimeout: number
|
|
2874
2939
|
enabledChunkLoadingTypes?: Array<string>
|
|
@@ -3036,6 +3101,10 @@ export interface RawRstestDynamicImportOriginOptions {
|
|
|
3036
3101
|
functionName?: string
|
|
3037
3102
|
}
|
|
3038
3103
|
|
|
3104
|
+
export interface RawRstestImportMetaResolveOriginOptions {
|
|
3105
|
+
functionName?: string
|
|
3106
|
+
}
|
|
3107
|
+
|
|
3039
3108
|
export interface RawRstestPluginOptions {
|
|
3040
3109
|
injectModulePathName: boolean
|
|
3041
3110
|
importMetaPathName: boolean
|
|
@@ -3048,8 +3117,18 @@ export interface RawRstestPluginOptions {
|
|
|
3048
3117
|
* `globalThis['@rstest/core/import-meta']?.(<absolute source path>)`.
|
|
3049
3118
|
*/
|
|
3050
3119
|
injectImportMetaRstestOrigin?: boolean
|
|
3051
|
-
injectDynamicImportOrigin?: boolean | { functionName?: string }
|
|
3052
|
-
|
|
3120
|
+
injectDynamicImportOrigin?: boolean | { functionName?: string }
|
|
3121
|
+
updateImportMockAPI?: boolean
|
|
3122
|
+
updateRequireMockAPI?: boolean
|
|
3123
|
+
injectRequireResolveOrigin?: boolean | { functionName?: string }
|
|
3124
|
+
/**
|
|
3125
|
+
* Replace `import.meta.resolve` with a call to a runtime factory receiving
|
|
3126
|
+
* the absolute source path. The factory must return a stable resolver for
|
|
3127
|
+
* that source module. Defaults to `__rstest_import_meta_resolve__`.
|
|
3128
|
+
* Modules with `parser.importMetaResolve: true` use Rspack's built-in
|
|
3129
|
+
* resolution instead.
|
|
3130
|
+
*/
|
|
3131
|
+
injectImportMetaResolveOrigin?: boolean | { functionName?: string }
|
|
3053
3132
|
}
|
|
3054
3133
|
|
|
3055
3134
|
export interface RawRstestRequireResolveOriginOptions {
|
|
@@ -3070,7 +3149,7 @@ export declare enum RawRuleSetConditionType {
|
|
|
3070
3149
|
regexp = 'regexp',
|
|
3071
3150
|
logical = 'logical',
|
|
3072
3151
|
array = 'array',
|
|
3073
|
-
func = 'func'
|
|
3152
|
+
func = 'func',
|
|
3074
3153
|
}
|
|
3075
3154
|
|
|
3076
3155
|
export interface RawRuleSetLogicalConditions {
|
|
@@ -3113,6 +3192,16 @@ export interface RawSnapshotOptions {
|
|
|
3113
3192
|
immutablePaths: Array<string|RegExp>
|
|
3114
3193
|
unmanagedPaths: Array<string|RegExp>
|
|
3115
3194
|
managedPaths: Array<string|RegExp>
|
|
3195
|
+
buildDependencies: RawSnapshotStrategyOptions
|
|
3196
|
+
resolveBuildDependencies: RawSnapshotStrategyOptions
|
|
3197
|
+
module: RawSnapshotStrategyOptions
|
|
3198
|
+
contextModule: RawSnapshotStrategyOptions
|
|
3199
|
+
resolve: RawSnapshotStrategyOptions
|
|
3200
|
+
}
|
|
3201
|
+
|
|
3202
|
+
export interface RawSnapshotStrategyOptions {
|
|
3203
|
+
hash: boolean
|
|
3204
|
+
timestamp: boolean
|
|
3116
3205
|
}
|
|
3117
3206
|
|
|
3118
3207
|
export interface RawSplitChunkSizes {
|
|
@@ -3120,6 +3209,7 @@ export interface RawSplitChunkSizes {
|
|
|
3120
3209
|
}
|
|
3121
3210
|
|
|
3122
3211
|
export interface RawSplitChunksOptions {
|
|
3212
|
+
dedupDepth?: number
|
|
3123
3213
|
fallbackCacheGroup?: RawFallbackCacheGroupOptions
|
|
3124
3214
|
name?: string | false | ((ctx: JsChunkOptionNameCtx) => string | undefined)
|
|
3125
3215
|
nameBatch?: ((batch: JsChunkOptionNameBatch) => (string | undefined)[])
|
|
@@ -3157,12 +3247,14 @@ export interface RawStatsOptions {
|
|
|
3157
3247
|
export interface RawStorageOptions {
|
|
3158
3248
|
type: "filesystem"
|
|
3159
3249
|
directory: string
|
|
3250
|
+
location: string
|
|
3160
3251
|
}
|
|
3161
3252
|
|
|
3162
3253
|
export interface RawSubresourceIntegrityPluginOptions {
|
|
3163
3254
|
integrityCallback?: (data: RawIntegrityData) => void
|
|
3164
3255
|
hashFuncNames: Array<string>
|
|
3165
3256
|
htmlPlugin: "JavaScript" | "Native" | "Disabled"
|
|
3257
|
+
hashLoading: "eager" | "lazy"
|
|
3166
3258
|
}
|
|
3167
3259
|
|
|
3168
3260
|
export interface RawSwcEmitDtsOptions {
|
|
@@ -3191,7 +3283,7 @@ export declare enum RawSyncModuleIdsPluginMode {
|
|
|
3191
3283
|
Read = 'read',
|
|
3192
3284
|
Create = 'create',
|
|
3193
3285
|
Merge = 'merge',
|
|
3194
|
-
Update = 'update'
|
|
3286
|
+
Update = 'update',
|
|
3195
3287
|
}
|
|
3196
3288
|
|
|
3197
3289
|
export interface RawSyncModuleIdsPluginOptions {
|
|
@@ -3291,7 +3383,7 @@ export declare enum RegisterJsTapKind {
|
|
|
3291
3383
|
RsdoctorPluginChunkGraph = 50,
|
|
3292
3384
|
RsdoctorPluginModuleIds = 51,
|
|
3293
3385
|
RsdoctorPluginModuleSources = 52,
|
|
3294
|
-
RsdoctorPluginAssets = 53
|
|
3386
|
+
RsdoctorPluginAssets = 53,
|
|
3295
3387
|
}
|
|
3296
3388
|
|
|
3297
3389
|
export interface RegisterJsTaps {
|
|
@@ -3409,6 +3501,7 @@ export interface ThreadsafeNodeFS {
|
|
|
3409
3501
|
readFile: (name: string) => Promise<Buffer | string | void>
|
|
3410
3502
|
stat: (name: string) => Promise<NodeFsStats | void>
|
|
3411
3503
|
lstat: (name: string) => Promise<NodeFsStats | void>
|
|
3504
|
+
readlink: (name: string) => Promise<string | void>
|
|
3412
3505
|
realpath: (name: string) => Promise<string | void>
|
|
3413
3506
|
open: (name: string, flags: string) => Promise<number | void>
|
|
3414
3507
|
rename: (from: string, to: string) => Promise<void>
|
package/package.json
CHANGED
|
@@ -1,21 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ohos-ports/rspack-binding",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.2-beta.0",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"description": "Node binding for rspack",
|
|
5
|
+
"description": "Node binding loader for rspack (OpenHarmony port: probes @ohos-ports/rspack-binding-openharmony-arm64 on openharmony/arm64)",
|
|
6
6
|
"main": "binding.js",
|
|
7
7
|
"types": "binding.d.ts",
|
|
8
8
|
"files": [
|
|
9
9
|
"binding.js",
|
|
10
10
|
"binding.d.ts",
|
|
11
11
|
"napi-binding.d.ts",
|
|
12
|
-
"webcontainer-fallback.cjs"
|
|
13
|
-
"rspack.openharmony-arm64-ohos.node"
|
|
12
|
+
"webcontainer-fallback.cjs"
|
|
14
13
|
],
|
|
14
|
+
"optionalDependencies": {
|
|
15
|
+
"@ohos-ports/rspack-binding-openharmony-arm64": "2.3.2-beta.0"
|
|
16
|
+
},
|
|
15
17
|
"homepage": "https://rspack.rs",
|
|
16
|
-
"bugs":
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://github.com/ohos-ports/ohos-ports/issues"
|
|
20
|
+
},
|
|
17
21
|
"repository": {
|
|
18
22
|
"type": "git",
|
|
19
|
-
"url": "
|
|
23
|
+
"url": "https://github.com/ohos-ports/ohos-ports.git",
|
|
24
|
+
"directory": "ports/@rspack/binding/2.3.2"
|
|
25
|
+
},
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
20
28
|
}
|
|
21
29
|
}
|