@ohos-ports/rspack-core 2.2.9-beta.0 → 2.3.4-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 +7 -7
- package/compiled/http-proxy-middleware/index.d.ts +12 -10
- package/compiled/http-proxy-middleware/package.json +1 -1
- package/compiled/tinypool/dist/index.js +5 -3
- package/compiled/watchpack/index.js +459 -60
- package/compiled/watchpack/package.json +1 -1
- package/compiled/watchpack/types/DirectoryWatcher.d.ts +24 -0
- package/compiled/watchpack/types/index.d.ts +1 -1
- package/compiled/watchpack/types/watchEventSource.d.ts +9 -0
- package/compiled/webpack-sources/index.d.ts +2 -0
- package/compiled/webpack-sources/index.js +207 -94
- package/compiled/webpack-sources/package.json +1 -1
- package/compiled/webpack-sources/types/RawSource.d.ts +0 -10
- package/compiled/webpack-sources/types/helpers/sourceMap.d.ts +47 -0
- package/compiled/webpack-sources/types/index.d.ts +1 -0
- package/dist/BuildInfo.d.ts +7 -0
- package/dist/Compilation.d.ts +3 -1
- package/dist/Compiler.d.ts +5 -6
- package/dist/ConcatenatedModule.d.ts +5 -1
- package/dist/ContextModule.d.ts +3 -1
- package/dist/ExternalModule.d.ts +7 -6
- package/dist/FileSystemInfo.d.ts +1 -0
- package/dist/Module.d.ts +12 -8
- package/dist/ModuleGraphConnection.d.ts +9 -3
- package/dist/NativeWatchFileSystem.d.ts +19 -7
- package/dist/NormalModule.d.ts +14 -6
- package/dist/RuntimeGlobals.d.ts +2 -1
- package/dist/RuntimeTemplate.d.ts +2 -0
- package/dist/Stats.d.ts +1 -1
- package/dist/builtin-loader/lightningcss/index.d.ts +5 -1
- package/dist/builtin-plugin/CompactHashedChunkIdsPlugin.d.ts +1 -0
- package/dist/builtin-plugin/CompactHashedModuleIdsPlugin.d.ts +1 -0
- package/dist/builtin-plugin/DeterministicChunkIdsPlugin.d.ts +5 -0
- package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +3 -2
- package/dist/builtin-plugin/ImportedByDeferModulesPlugin.d.ts +9 -0
- package/dist/builtin-plugin/SubresourceIntegrityPlugin.d.ts +1 -0
- package/dist/builtin-plugin/index.d.ts +1 -0
- package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +2 -2
- package/dist/config/adapterRuleUse.d.ts +1 -0
- package/dist/config/normalization.d.ts +2 -2
- package/dist/config/target.d.ts +6 -0
- package/dist/config/types.d.ts +69 -36
- package/dist/cssExtractHmr.js +1 -1
- package/dist/cssExtractLoader.js +1 -1
- package/dist/exports.d.ts +5 -4
- package/dist/index.js +1577 -1151
- package/dist/loader-runner/codeFilter.d.ts +9 -0
- package/dist/loader-runner/dependencies.d.ts +1 -1
- package/dist/loader-runner/index.d.ts +2 -1
- package/dist/loader-runner/service.d.ts +0 -4
- package/dist/loader-runner/worker.d.ts +4 -1
- package/dist/node/NodeWatchFileSystem.d.ts +7 -4
- package/dist/sharing/IndependentSharedPlugin.d.ts +1 -2
- package/dist/sharing/utils.d.ts +1 -1
- package/dist/sources.d.ts +3 -0
- package/dist/stats/statsFactoryUtils.d.ts +7 -0
- package/dist/util/bindingHelpers.d.ts +2 -0
- package/dist/util/createModule.d.ts +3 -0
- package/dist/util/fs.d.ts +13 -7
- package/dist/util/resolveLayerExternals.d.ts +1 -0
- package/dist/util/source.d.ts +12 -3
- package/dist/util/symbols.d.ts +10 -0
- package/dist/util/watchTimeInfo.d.ts +5 -1
- package/dist/worker.js +327 -326
- package/hot/lazy-compilation-node.js +1 -1
- package/hot/lazy-compilation-web.js +1 -1
- package/package.json +4 -4
- package/dist/loader-runner/cache.d.ts +0 -27
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export type RawSourceMap = import("../Source").RawSourceMap;
|
|
2
|
+
/**
|
|
3
|
+
* Where a generated position came from: `line` counts from one, `column`
|
|
4
|
+
* from zero, as in a stack trace.
|
|
5
|
+
*/
|
|
6
|
+
export type OriginalPosition = {
|
|
7
|
+
/**
|
|
8
|
+
* source, joined with the map's `sourceRoot`
|
|
9
|
+
*/
|
|
10
|
+
source: string;
|
|
11
|
+
/**
|
|
12
|
+
* line
|
|
13
|
+
*/
|
|
14
|
+
line: number;
|
|
15
|
+
/**
|
|
16
|
+
* column
|
|
17
|
+
*/
|
|
18
|
+
column: number;
|
|
19
|
+
/**
|
|
20
|
+
* name, if the mapping carries one
|
|
21
|
+
*/
|
|
22
|
+
name: string | null;
|
|
23
|
+
};
|
|
24
|
+
/** @typedef {import("../Source").RawSourceMap} RawSourceMap */
|
|
25
|
+
/**
|
|
26
|
+
* Where a generated position came from: `line` counts from one, `column`
|
|
27
|
+
* from zero, as in a stack trace.
|
|
28
|
+
* @typedef {object} OriginalPosition
|
|
29
|
+
* @property {string} source source, joined with the map's `sourceRoot`
|
|
30
|
+
* @property {number} line line
|
|
31
|
+
* @property {number} column column
|
|
32
|
+
* @property {string | null} name name, if the mapping carries one
|
|
33
|
+
*/
|
|
34
|
+
/**
|
|
35
|
+
* Finds the original position of a generated one: the closest mapping at or
|
|
36
|
+
* before `column` on `line`. Decodes the whole map, so it suits a one-off
|
|
37
|
+
* lookup (an error location), not a loop over many positions.
|
|
38
|
+
* @param {RawSourceMap | string | Buffer} sourceMap source map, or its JSON
|
|
39
|
+
* @param {number} line generated line, counting from one
|
|
40
|
+
* @param {number} column generated column, counting from zero
|
|
41
|
+
* @returns {OriginalPosition | null} original position, or `null` when nothing maps there
|
|
42
|
+
*/
|
|
43
|
+
export function originalPositionFor(
|
|
44
|
+
sourceMap: RawSourceMap | string | Buffer,
|
|
45
|
+
line: number,
|
|
46
|
+
column: number,
|
|
47
|
+
): OriginalPosition | null;
|
|
@@ -29,6 +29,7 @@ declare namespace _exports {
|
|
|
29
29
|
const CompatSource: typeof import("./CompatSource");
|
|
30
30
|
namespace util {
|
|
31
31
|
const scopes: typeof import("./helpers/scopes");
|
|
32
|
+
const sourceMap: typeof import("./helpers/sourceMap");
|
|
32
33
|
const stringBufferUtils: typeof import("./helpers/stringBufferUtils");
|
|
33
34
|
}
|
|
34
35
|
}
|
package/dist/BuildInfo.d.ts
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import binding from '@rspack/binding';
|
|
2
2
|
import type { Source } from '../compiled/webpack-sources/index.js';
|
|
3
|
+
import { BUILD_INFO_ASSETS_SYMBOL, BUILD_INFO_BUILD_DEPENDENCIES_SYMBOL, BUILD_INFO_CONTEXT_DEPENDENCIES_SYMBOL, BUILD_INFO_FILE_DEPENDENCIES_SYMBOL, BUILD_INFO_MISSING_DEPENDENCIES_SYMBOL, COMMIT_CUSTOM_FIELDS_SYMBOL } from './util/symbols.js';
|
|
3
4
|
declare const $assets: unique symbol;
|
|
4
5
|
declare module '@rspack/binding' {
|
|
5
6
|
interface Assets {
|
|
6
7
|
[$assets]: Record<string, Source>;
|
|
7
8
|
}
|
|
8
9
|
interface KnownBuildInfo {
|
|
10
|
+
[BUILD_INFO_ASSETS_SYMBOL]: binding.Assets;
|
|
11
|
+
[BUILD_INFO_FILE_DEPENDENCIES_SYMBOL]: string[];
|
|
12
|
+
[BUILD_INFO_CONTEXT_DEPENDENCIES_SYMBOL]: string[];
|
|
13
|
+
[BUILD_INFO_MISSING_DEPENDENCIES_SYMBOL]: string[];
|
|
14
|
+
[BUILD_INFO_BUILD_DEPENDENCIES_SYMBOL]: string[];
|
|
15
|
+
[COMMIT_CUSTOM_FIELDS_SYMBOL](): void;
|
|
9
16
|
assets: Record<string, Source>;
|
|
10
17
|
fileDependencies: Set<string>;
|
|
11
18
|
contextDependencies: Set<string>;
|
package/dist/Compilation.d.ts
CHANGED
|
@@ -39,6 +39,7 @@ import './ChunkGraph.js';
|
|
|
39
39
|
import './CodeGenerationResults.js';
|
|
40
40
|
import { type FileSystemDependencies } from './FileSystemDependencies.js';
|
|
41
41
|
import type { CodeGenerationResult } from './taps/compilation.js';
|
|
42
|
+
import { COMPILATION_HOOKS_MAP_SYMBOL } from './util/symbols.js';
|
|
42
43
|
export type Assets = Record<string, Source>;
|
|
43
44
|
export interface Asset {
|
|
44
45
|
name: string;
|
|
@@ -134,6 +135,7 @@ export interface KnownNormalizedStatsOptions {
|
|
|
134
135
|
optimizationBailout: boolean;
|
|
135
136
|
depth: boolean;
|
|
136
137
|
assets: boolean;
|
|
138
|
+
cacheInfo: boolean;
|
|
137
139
|
chunks: boolean;
|
|
138
140
|
errors: boolean;
|
|
139
141
|
errorsCount: boolean;
|
|
@@ -211,7 +213,7 @@ export declare class Compilation {
|
|
|
211
213
|
createSnapshot(): null;
|
|
212
214
|
};
|
|
213
215
|
needAdditionalPass: boolean;
|
|
214
|
-
[
|
|
216
|
+
[COMPILATION_HOOKS_MAP_SYMBOL]: WeakMap<object, unknown>;
|
|
215
217
|
constructor(compiler: Compiler, inner: JsCompilation);
|
|
216
218
|
get hash(): Readonly<string | null>;
|
|
217
219
|
get fullHash(): Readonly<string | null>;
|
package/dist/Compiler.d.ts
CHANGED
|
@@ -9,13 +9,12 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import type binding from '@rspack/binding';
|
|
11
11
|
import * as liteTapable from '../compiled/@rspack/lite-tapable/dist/index.js';
|
|
12
|
-
import type Watchpack from '../compiled/watchpack/index.js';
|
|
13
12
|
import type { Source } from '../compiled/webpack-sources/index.js';
|
|
14
13
|
import type { Chunk } from './Chunk.js';
|
|
15
14
|
import type { CompilationParams } from './Compilation.js';
|
|
16
15
|
import { Compilation } from './Compilation.js';
|
|
17
16
|
import { ContextModuleFactory } from './ContextModuleFactory.js';
|
|
18
|
-
import type { EntryNormalized, Falsy, OutputNormalized, RspackOptionsNormalized, RspackPluginInstance } from './config/index.js';
|
|
17
|
+
import type { EntryNormalized, Falsy, OutputNormalized, RspackOptionsNormalized, RspackPluginInstance, WatchOptions } from './config/index.js';
|
|
19
18
|
import type { ExtractedTargetProperties, PlatformTargetProperties } from './config/target.js';
|
|
20
19
|
import type { FileSystemInfoEntry } from './FileSystemInfo.js';
|
|
21
20
|
import type { rspack } from './index.js';
|
|
@@ -26,7 +25,7 @@ import { NormalModuleFactory } from './NormalModuleFactory.js';
|
|
|
26
25
|
import { ResolverFactory } from './ResolverFactory.js';
|
|
27
26
|
import { RuleSetCompiler } from './RuleSetCompiler.js';
|
|
28
27
|
import { Stats } from './Stats.js';
|
|
29
|
-
import type { InputFileSystem, IntermediateFileSystem, OutputFileSystem, WatchFileSystem } from './util/fs.js';
|
|
28
|
+
import type { ExistenceOnlyTimeEntry, InputFileSystem, IntermediateFileSystem, OutputFileSystem, WatchFileSystem } from './util/fs.js';
|
|
30
29
|
import { Watching } from './Watching.js';
|
|
31
30
|
export interface AssetEmittedInfo {
|
|
32
31
|
content: Buffer;
|
|
@@ -101,8 +100,8 @@ declare class Compiler {
|
|
|
101
100
|
records: Record<string, any[]>;
|
|
102
101
|
modifiedFiles?: ReadonlySet<string>;
|
|
103
102
|
removedFiles?: ReadonlySet<string>;
|
|
104
|
-
fileTimestamps?: ReadonlyMap<string, FileSystemInfoEntry | 'ignore' | null>;
|
|
105
|
-
contextTimestamps?: ReadonlyMap<string, FileSystemInfoEntry | 'ignore' | null>;
|
|
103
|
+
fileTimestamps?: ReadonlyMap<string, FileSystemInfoEntry | ExistenceOnlyTimeEntry | 'ignore' | null>;
|
|
104
|
+
contextTimestamps?: ReadonlyMap<string, FileSystemInfoEntry | ExistenceOnlyTimeEntry | 'ignore' | null>;
|
|
106
105
|
fsStartTime?: number;
|
|
107
106
|
watchMode: boolean;
|
|
108
107
|
context: string;
|
|
@@ -157,7 +156,7 @@ declare class Compiler {
|
|
|
157
156
|
* @param handler - signals when the call finishes
|
|
158
157
|
* @returns a compiler watcher
|
|
159
158
|
*/
|
|
160
|
-
watch(watchOptions:
|
|
159
|
+
watch(watchOptions: WatchOptions, handler: liteTapable.Callback<Error, Stats>): Watching;
|
|
161
160
|
/**
|
|
162
161
|
* @param callback - signals when the call finishes
|
|
163
162
|
* @param options - additional data like modifiedFiles, removedFiles
|
package/dist/ContextModule.d.ts
CHANGED
package/dist/ExternalModule.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import binding from '@rspack/binding';
|
|
2
1
|
import * as liteTapable from '../compiled/@rspack/lite-tapable/dist/index.js';
|
|
3
2
|
import type { Chunk } from './Chunk.js';
|
|
4
3
|
import { type Compilation } from './Compilation.js';
|
|
5
|
-
|
|
4
|
+
import { Module } from './Module.js';
|
|
6
5
|
export type ExternalModuleCompilationHooks = {
|
|
7
6
|
chunkCondition: liteTapable.SyncBailHook<[
|
|
8
7
|
Chunk,
|
|
9
8
|
Compilation
|
|
10
9
|
], boolean | undefined>;
|
|
11
10
|
};
|
|
12
|
-
declare
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
export declare class ExternalModule extends Module {
|
|
12
|
+
#private;
|
|
13
|
+
readonly userRequest: string;
|
|
14
|
+
constructor();
|
|
15
|
+
static getCompilationHooks(compilation: Compilation): ExternalModuleCompilationHooks;
|
|
16
|
+
}
|
package/dist/FileSystemInfo.d.ts
CHANGED
package/dist/Module.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import binding
|
|
1
|
+
import binding from '@rspack/binding';
|
|
2
2
|
import type { Source } from '../compiled/webpack-sources/index.js';
|
|
3
3
|
import type { ResourceData } from './Resolver.js';
|
|
4
4
|
import './BuildInfo.js';
|
|
@@ -11,6 +11,12 @@ export type ResolveData = binding.JsResolveData & {
|
|
|
11
11
|
contextDependencies: string[];
|
|
12
12
|
missingDependencies: string[];
|
|
13
13
|
};
|
|
14
|
+
declare module '@rspack/binding' {
|
|
15
|
+
interface Module {
|
|
16
|
+
originalSource(): Source | null;
|
|
17
|
+
emitFile(filename: string, source: Source, assetInfo?: binding.AssetInfo): void;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
14
20
|
export declare class ContextModuleFactoryBeforeResolveData {
|
|
15
21
|
#private;
|
|
16
22
|
context: string;
|
|
@@ -35,11 +41,9 @@ export declare class ContextModuleFactoryAfterResolveData {
|
|
|
35
41
|
private constructor();
|
|
36
42
|
}
|
|
37
43
|
export type ContextModuleFactoryAfterResolveResult = false | ContextModuleFactoryAfterResolveData;
|
|
38
|
-
|
|
39
|
-
interface Module {
|
|
40
|
-
identifier(): string;
|
|
41
|
-
originalSource(): Source | null;
|
|
42
|
-
emitFile(filename: string, source: Source, assetInfo?: AssetInfo): void;
|
|
43
|
-
}
|
|
44
|
+
export interface Module extends binding.Module {
|
|
44
45
|
}
|
|
45
|
-
export
|
|
46
|
+
export declare const Module: {
|
|
47
|
+
new (): Module;
|
|
48
|
+
readonly prototype: Module;
|
|
49
|
+
};
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ModuleGraphConnection as BindingModuleGraphConnection } from '@rspack/binding';
|
|
2
|
+
import { CIRCULAR_CONNECTION_SYMBOL, TRANSITIVE_ONLY_SYMBOL } from './util/symbols.js';
|
|
2
3
|
type ModuleGraphConnectionConstructor = typeof BindingModuleGraphConnection & {
|
|
3
|
-
readonly TRANSITIVE_ONLY: typeof
|
|
4
|
-
readonly CIRCULAR_CONNECTION: typeof
|
|
4
|
+
readonly TRANSITIVE_ONLY: typeof TRANSITIVE_ONLY_SYMBOL;
|
|
5
|
+
readonly CIRCULAR_CONNECTION: typeof CIRCULAR_CONNECTION_SYMBOL;
|
|
5
6
|
};
|
|
6
7
|
export interface ModuleGraphConnection extends BindingModuleGraphConnection {
|
|
7
8
|
}
|
|
8
9
|
export declare const ModuleGraphConnection: ModuleGraphConnectionConstructor;
|
|
9
10
|
export type ConnectionState = boolean | typeof ModuleGraphConnection.TRANSITIVE_ONLY | typeof ModuleGraphConnection.CIRCULAR_CONNECTION;
|
|
11
|
+
declare module '@rspack/binding' {
|
|
12
|
+
interface ModuleGraphConnection {
|
|
13
|
+
getActiveState(runtime: string | string[] | undefined): ConnectionState;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
10
16
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EventEmitter } from 'node:events';
|
|
2
2
|
import binding from '@rspack/binding';
|
|
3
|
-
import type
|
|
4
|
-
import type {
|
|
3
|
+
import type { WatchOptions } from './config/index.js';
|
|
4
|
+
import type { InputFileSystem, TimeInfoEntries, Watcher, WatchFileSystem } from './util/fs.js';
|
|
5
5
|
/**
|
|
6
6
|
* Minimal watchpack-compatible shim exposed as `NativeWatchFileSystem.watcher`.
|
|
7
7
|
*
|
|
@@ -9,15 +9,20 @@ import type { FileSystemInfoEntry, InputFileSystem, Watcher, WatchFileSystem } f
|
|
|
9
9
|
* `fork-ts-checker-webpack-plugin` rely on — `on`/`once` for `change`/`remove`,
|
|
10
10
|
* plus `_onChange`/`_onRemove` to inject events — onto the native watcher, so
|
|
11
11
|
* those plugins keep working under `experiments.nativeWatcher` unmodified.
|
|
12
|
+
* The times API (`getTimes`/`getTimeInfoEntries`/`collectTimeInfoEntries`) is
|
|
13
|
+
* forwarded to the owning file system, which reads it off the native watcher.
|
|
12
14
|
*
|
|
13
15
|
* APIs that iterate `fileWatchers`/`directoryWatchers` are intentionally not
|
|
14
16
|
* supported; plugins needing those should use `WatchFileSystem.emit` instead.
|
|
15
17
|
*/
|
|
16
18
|
declare class NativeWatcherShim extends EventEmitter {
|
|
17
19
|
#private;
|
|
18
|
-
constructor(
|
|
20
|
+
constructor(fileSystem: NativeWatchFileSystem);
|
|
19
21
|
_onChange(item: string, _mtime?: number, file?: string, _type?: string): void;
|
|
20
22
|
_onRemove(item: string, file?: string, _type?: string): void;
|
|
23
|
+
getTimes(): Record<string, number | null>;
|
|
24
|
+
getTimeInfoEntries(): TimeInfoEntries;
|
|
25
|
+
collectTimeInfoEntries(fileTimestamps: TimeInfoEntries, directoryTimestamps: TimeInfoEntries): void;
|
|
21
26
|
}
|
|
22
27
|
export default class NativeWatchFileSystem implements WatchFileSystem {
|
|
23
28
|
#private;
|
|
@@ -32,13 +37,20 @@ export default class NativeWatchFileSystem implements WatchFileSystem {
|
|
|
32
37
|
}, missing: Iterable<string> & {
|
|
33
38
|
added?: Iterable<string>;
|
|
34
39
|
removed?: Iterable<string>;
|
|
35
|
-
}, startTime: number, options:
|
|
36
|
-
|
|
40
|
+
}, startTime: number, options: WatchOptions, callback: (error: Error | null, fileTimeInfoEntries: TimeInfoEntries, contextTimeInfoEntries: TimeInfoEntries, changedFiles: Set<string>, removedFiles: Set<string>) => void, callbackUndelayed: (fileName: string, changeTime: number) => void): Watcher;
|
|
41
|
+
/**
|
|
42
|
+
* watchpack's times API, served from the native watcher's registered paths.
|
|
43
|
+
* Empty before the first `watch()` and after `close()`.
|
|
44
|
+
*/
|
|
45
|
+
getTimes(): Record<string, number | null>;
|
|
46
|
+
getTimeInfoEntries(): TimeInfoEntries;
|
|
47
|
+
collectTimeInfoEntries(fileTimestamps: TimeInfoEntries, directoryTimestamps: TimeInfoEntries): void;
|
|
48
|
+
getNativeWatcher(options: WatchOptions): binding.NativeWatcher;
|
|
37
49
|
triggerEvent(kind: 'change' | 'remove' | 'create', path: string): void;
|
|
38
|
-
on(event: 'change', listener: (filename: string, mtime: number) => void): this;
|
|
50
|
+
on(event: 'change', listener: (filename: string, mtime: number | null) => void): this;
|
|
39
51
|
on(event: 'remove', listener: (filename: string) => void): this;
|
|
40
52
|
on(event: 'aggregated', listener: (changes: Set<string>, removals: Set<string>) => void): this;
|
|
41
|
-
once(event: 'change', listener: (filename: string, mtime: number) => void): this;
|
|
53
|
+
once(event: 'change', listener: (filename: string, mtime: number | null) => void): this;
|
|
42
54
|
once(event: 'remove', listener: (filename: string) => void): this;
|
|
43
55
|
once(event: 'aggregated', listener: (changes: Set<string>, removals: Set<string>) => void): this;
|
|
44
56
|
emit(event: 'change', filename: string, mtime: number): boolean;
|
package/dist/NormalModule.d.ts
CHANGED
|
@@ -1,14 +1,22 @@
|
|
|
1
|
+
import binding from '@rspack/binding';
|
|
1
2
|
import * as liteTapable from '../compiled/@rspack/lite-tapable/dist/index.js';
|
|
2
3
|
import { type Compilation } from './Compilation.js';
|
|
3
4
|
import type { LoaderContext } from './config/index.js';
|
|
4
|
-
import
|
|
5
|
+
import { Module } from './Module.js';
|
|
5
6
|
export interface NormalModuleCompilationHooks {
|
|
6
7
|
loader: liteTapable.SyncHook<[LoaderContext, Module]>;
|
|
7
8
|
readResource: liteTapable.HookMap<liteTapable.AsyncSeriesBailHook<[LoaderContext], string | Buffer>>;
|
|
8
9
|
}
|
|
9
|
-
declare
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
export declare class NormalModule extends Module {
|
|
11
|
+
#private;
|
|
12
|
+
readonly resource: string;
|
|
13
|
+
readonly request: string;
|
|
14
|
+
readonly userRequest: string;
|
|
15
|
+
readonly rawRequest: string;
|
|
16
|
+
readonly resourceResolveData: Readonly<binding.JsResourceData> | undefined;
|
|
17
|
+
readonly loaders: binding.JsLoaderItem[];
|
|
18
|
+
matchResource: string | undefined;
|
|
19
|
+
readonly error: binding.RspackError | undefined;
|
|
20
|
+
constructor();
|
|
21
|
+
static getCompilationHooks(compilation: Compilation): NormalModuleCompilationHooks;
|
|
13
22
|
}
|
|
14
|
-
export { NormalModule } from '@rspack/binding';
|
package/dist/RuntimeGlobals.d.ts
CHANGED
|
@@ -356,6 +356,7 @@ export declare enum RuntimeVariable {
|
|
|
356
356
|
StartupExec = 6
|
|
357
357
|
}
|
|
358
358
|
export declare function renderRuntimeVariables(variable: RuntimeVariable, compilerOptions?: RspackOptionsNormalized): string;
|
|
359
|
+
export declare function renderRuntimeGlobalProperty(runtimeGlobal: RuntimeGlobals, compilerOptions?: RspackOptionsNormalized): string;
|
|
359
360
|
export declare function createCompilerRuntimeGlobals(compilerOptions?: RspackOptionsNormalized): Record<keyof typeof RuntimeGlobals, string>;
|
|
360
361
|
declare const DefaultRuntimeGlobals: Record<"amdDefine" | "amdOptions" | "asyncModule" | "asyncModuleExportSymbol" | "baseURI" | "chunkCallback" | "chunkName" | "compatGetDefaultExport" | "compileWasm" | "createFakeNamespaceObject" | "createScript" | "createScriptUrl" | "currentRemoteGetScope" | "deferredModuleExports" | "definePropertyGetters" | "ensureChunk" | "ensureChunkHandlers" | "ensureChunkIncludeEntries" | "entryModuleId" | "exports" | "externalInstallChunk" | "getChunkCssFilename" | "getChunkScriptFilename" | "getChunkUpdateCssFilename" | "getChunkUpdateScriptFilename" | "getFullHash" | "getTrustedTypesPolicy" | "getUpdateManifestFilename" | "global" | "harmonyModuleDecorator" | "hasCssModules" | "hasFetchPriority" | "hasOwnProperty" | "hmrDownloadManifest" | "hmrDownloadUpdateHandlers" | "hmrInvalidateModuleHandlers" | "hmrModuleData" | "hmrRuntimeStatePrefix" | "initializeSharing" | "instantiateWasm" | "interceptModuleExecution" | "loadScript" | "makeDeferredNamespaceObject" | "makeDeferredNamespaceObjectSymbol" | "makeNamespaceObject" | "module" | "moduleCache" | "moduleFactories" | "moduleFactoriesAddOnly" | "moduleId" | "moduleLoaded" | "nodeModuleDecorator" | "onChunksLoaded" | "prefetchChunk" | "prefetchChunkHandlers" | "preloadChunk" | "preloadChunkHandlers" | "publicPath" | "relativeUrl" | "require" | "requireScope" | "returnExportsFromRuntime" | "rspackUniqueId" | "rspackVersion" | "runtimeId" | "scriptNonce" | "shareScopeMap" | "startup" | "startupChunkDependencies" | "startupEntrypoint" | "startupNoDefault" | "startupOnlyAfter" | "startupOnlyBefore" | "system" | "systemContext" | "thisAsExports" | "uncaughtErrorHandler" | "wasmInstances", string>;
|
|
361
|
-
export { DefaultRuntimeGlobals as RuntimeGlobals };
|
|
362
|
+
export { RuntimeGlobals as RuntimeGlobal, DefaultRuntimeGlobals as RuntimeGlobals, };
|
|
@@ -51,10 +51,12 @@ export declare class RuntimeTemplate {
|
|
|
51
51
|
supportsOptionalChaining(): boolean;
|
|
52
52
|
supportsForOf(): boolean;
|
|
53
53
|
supportsDestructuring(): boolean;
|
|
54
|
+
supportsSpread(): boolean;
|
|
54
55
|
supportsBigIntLiteral(): boolean;
|
|
55
56
|
supportsDynamicImport(): boolean;
|
|
56
57
|
supportsEcmaScriptModuleSyntax(): boolean;
|
|
57
58
|
supportTemplateLiteral(): boolean;
|
|
59
|
+
supportsTopLevelAwait(): boolean;
|
|
58
60
|
supportNodePrefixForCoreModules(): boolean;
|
|
59
61
|
/**
|
|
60
62
|
* @param mod a module
|
package/dist/Stats.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Compilation } from './Compilation.js';
|
|
2
2
|
import type { StatsOptions, StatsValue } from './config/index.js';
|
|
3
3
|
import type { StatsCompilation } from './stats/statsFactoryUtils.js';
|
|
4
|
-
export type { StatsAsset, StatsChunk, StatsCompilation, StatsError, StatsModule, } from './stats/statsFactoryUtils.js';
|
|
4
|
+
export type { StatsAsset, StatsCacheInfo, StatsChunk, StatsCompilation, StatsError, StatsModule, } from './stats/statsFactoryUtils.js';
|
|
5
5
|
export declare class Stats {
|
|
6
6
|
#private;
|
|
7
7
|
constructor(compilation: Compilation);
|
|
@@ -45,9 +45,10 @@ export declare enum Features {
|
|
|
45
45
|
DoublePositionGradients = 131072,
|
|
46
46
|
VendorPrefixes = 262144,
|
|
47
47
|
LogicalProperties = 524288,
|
|
48
|
+
LightDark = 1048576,
|
|
48
49
|
Selectors = 31,
|
|
49
50
|
MediaQueries = 448,
|
|
50
|
-
Color =
|
|
51
|
+
Color = 1113088
|
|
51
52
|
}
|
|
52
53
|
export interface Targets {
|
|
53
54
|
android?: string;
|
|
@@ -63,6 +64,8 @@ export interface Targets {
|
|
|
63
64
|
export interface Drafts {
|
|
64
65
|
/** Whether to enable @custom-media rules. */
|
|
65
66
|
customMedia?: boolean;
|
|
67
|
+
/** Whether to enable scroll navigation pseudo-classes. */
|
|
68
|
+
scrollNavigationControls?: boolean;
|
|
66
69
|
}
|
|
67
70
|
export interface NonStandard {
|
|
68
71
|
/** Whether to enable the non-standard >>> and /deep/ selector combinators used by Angular and Vue. */
|
|
@@ -96,6 +99,7 @@ export type FeatureOptions = {
|
|
|
96
99
|
doublePositionGradients?: boolean;
|
|
97
100
|
vendorPrefixes?: boolean;
|
|
98
101
|
logicalProperties?: boolean;
|
|
102
|
+
lightDark?: boolean;
|
|
99
103
|
selectors?: boolean;
|
|
100
104
|
mediaQueries?: boolean;
|
|
101
105
|
color?: boolean;
|
|
@@ -2,6 +2,7 @@ import { type BuiltinPlugin, BuiltinPluginName } from '@rspack/binding';
|
|
|
2
2
|
import { RspackBuiltinPlugin } from './base.js';
|
|
3
3
|
export interface CompactHashedChunkIdsPluginOptions {
|
|
4
4
|
minLength?: number;
|
|
5
|
+
salt?: number;
|
|
5
6
|
}
|
|
6
7
|
export declare class CompactHashedChunkIdsPlugin extends RspackBuiltinPlugin {
|
|
7
8
|
private options;
|
|
@@ -2,6 +2,7 @@ import { type BuiltinPlugin, BuiltinPluginName } from '@rspack/binding';
|
|
|
2
2
|
import { RspackBuiltinPlugin } from './base.js';
|
|
3
3
|
export interface CompactHashedModuleIdsPluginOptions {
|
|
4
4
|
minLength?: number;
|
|
5
|
+
salt?: number;
|
|
5
6
|
}
|
|
6
7
|
export declare class CompactHashedModuleIdsPlugin extends RspackBuiltinPlugin {
|
|
7
8
|
private options;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { type BuiltinPlugin, BuiltinPluginName } from '@rspack/binding';
|
|
2
2
|
import { RspackBuiltinPlugin } from './base.js';
|
|
3
|
+
export interface DeterministicChunkIdsPluginOptions {
|
|
4
|
+
salt?: number;
|
|
5
|
+
}
|
|
3
6
|
export declare class DeterministicChunkIdsPlugin extends RspackBuiltinPlugin {
|
|
7
|
+
private options;
|
|
4
8
|
name: BuiltinPluginName;
|
|
5
9
|
affectedHooks: 'compilation';
|
|
10
|
+
constructor(options?: DeterministicChunkIdsPluginOptions);
|
|
6
11
|
raw(): BuiltinPlugin;
|
|
7
12
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { type SourceMapDevToolPluginOptions } from '@rspack/binding';
|
|
2
|
+
export type EvalSourceMapDevToolPluginOptions = Pick<SourceMapDevToolPluginOptions, 'columns' | 'debugIds' | 'exclude' | 'ignoreList' | 'include' | 'module' | 'moduleFilenameTemplate' | 'namespace' | 'noSources' | 'sourceRoot' | 'test'>;
|
|
2
3
|
export declare const EvalSourceMapDevToolPlugin: {
|
|
3
|
-
new (options:
|
|
4
|
+
new (options: EvalSourceMapDevToolPluginOptions): {
|
|
4
5
|
name: string;
|
|
5
|
-
_args: [options:
|
|
6
|
+
_args: [options: EvalSourceMapDevToolPluginOptions];
|
|
6
7
|
affectedHooks: keyof import("../index.js").CompilerHooks | undefined;
|
|
7
8
|
raw(compiler: import("../index.js").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
8
9
|
apply(compiler: import("../index.js").Compiler): void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const ImportedByDeferModulesPlugin: {
|
|
2
|
+
new (): {
|
|
3
|
+
name: string;
|
|
4
|
+
_args: [];
|
|
5
|
+
affectedHooks: keyof import("../index.js").CompilerHooks | undefined;
|
|
6
|
+
raw(compiler: import("../index.js").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
7
|
+
apply(compiler: import("../index.js").Compiler): void;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
@@ -8,6 +8,7 @@ export type SubresourceIntegrityPluginOptions = {
|
|
|
8
8
|
];
|
|
9
9
|
htmlPlugin?: string | false;
|
|
10
10
|
enabled?: 'auto' | boolean;
|
|
11
|
+
hashLoading?: 'eager' | 'lazy';
|
|
11
12
|
};
|
|
12
13
|
export type NativeSubresourceIntegrityPluginOptions = Omit<RawSubresourceIntegrityPluginOptions, 'htmlPlugin'> & {
|
|
13
14
|
htmlPlugin: string | false;
|
|
@@ -48,6 +48,7 @@ export * from './HttpUriPlugin.js';
|
|
|
48
48
|
export * from './html-plugin/index.js';
|
|
49
49
|
export * from './IgnorePlugin.js';
|
|
50
50
|
export * from './InferAsyncModulesPlugin.js';
|
|
51
|
+
export * from './ImportedByDeferModulesPlugin.js';
|
|
51
52
|
export * from './InlineExportsPlugin.js';
|
|
52
53
|
export * from './JavascriptModulesPlugin.js';
|
|
53
54
|
export * from './JsLoaderRspackPlugin.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Module } from '../../Module.js';
|
|
2
2
|
export declare const BuiltinLazyCompilationPlugin: {
|
|
3
|
-
new (takeNewlyActiveModules: () => Set<string>, entries: boolean, imports: boolean, client: string,
|
|
3
|
+
new (takeNewlyActiveModules: () => Set<string>, entries: boolean, imports: boolean, client: string, collectReservedExternals: (layer?: string | null) => string[], test?: RegExp | ((module: Module) => boolean) | undefined): {
|
|
4
4
|
name: string;
|
|
5
|
-
_args: [takeNewlyActiveModules: () => Set<string>, entries: boolean, imports: boolean, client: string,
|
|
5
|
+
_args: [takeNewlyActiveModules: () => Set<string>, entries: boolean, imports: boolean, client: string, collectReservedExternals: (layer?: string | null) => string[], test?: RegExp | ((module: Module) => boolean) | undefined];
|
|
6
6
|
affectedHooks: keyof import("../../index.js").CompilerHooks | undefined;
|
|
7
7
|
raw(compiler: import("../../index.js").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
8
8
|
apply(compiler: import("../../index.js").Compiler): void;
|
|
@@ -421,5 +421,6 @@ export type LoaderDefinition<OptionsType = {}, ContextAdditions = {}> = LoaderDe
|
|
|
421
421
|
};
|
|
422
422
|
export declare function createRawModuleRuleUses(uses: RuleSetUseItem | RuleSetUseItem[], path: string, options: ComposeJsUseOptions): RawModuleRuleUse[];
|
|
423
423
|
export type GetLoaderOptions = (o: RuleSetLoaderWithOptions['options'], options: ComposeJsUseOptions) => RuleSetLoaderWithOptions['options'];
|
|
424
|
+
export declare function serializeLoaderOptionsForCache(options: unknown): string | undefined;
|
|
424
425
|
export declare function isUseSourceMap(devtool: RspackOptionsNormalized['devtool']): boolean;
|
|
425
426
|
export declare function isUseSimpleSourceMap(devtool: RspackOptionsNormalized['devtool']): boolean;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
import type { HttpUriPluginOptions } from '../builtin-plugin/index.js';
|
|
11
11
|
import type { Compilation } from '../Compilation.js';
|
|
12
12
|
import type WebpackError from '../lib/WebpackError.js';
|
|
13
|
-
import type { Amd, AssetModuleFilename, Bail, BundlerInfoOptions, SnapshotOptions,
|
|
13
|
+
import type { Amd, AssetModuleFilename, Bail, BundlerInfoOptions, SnapshotOptions, ChunkFilename, ChunkLoading, ChunkLoadingGlobal, Clean, Context, CrossOriginLoading, CssChunkFilename, CssFilename, Dependencies, DevServer, DevTool, DevtoolFallbackModuleFilenameTemplate, DevtoolModuleFilenameTemplate, DevtoolNamespace, EnabledLibraryTypes, EnabledWasmLoadingTypes, EntryDescription, Environment, Externals, ExternalsPresets, ExternalsType, Filename, GeneratorOptionsByModuleType, GlobalObject, HashDigest, HashDigestLength, HashFunction, HashSalt, HotUpdateChunkFilename, HotUpdateGlobal, HotUpdateMainFilename, Iife, ImportFunctionName, ImportMetaName, Incremental, InfrastructureLogging, LazyCompilationOptions, LibraryOptions, Loader, Mode, NewCache, Name, Node, NoParseOption, Optimization, OutputModule, ParserOptionsByModuleType, Path, Performance, Plugins, PublicPath, Resolve, RspackOptions, RuleSetRules, ScriptType, SourceMapFilename, StatsValue, StrictModuleErrorHandling, Target, TrustedTypes, UniqueName, WasmLoading, WasmStreamingFallback, Watch, WatchOptions, WebassemblyModuleFilename, WorkerPublicPath } from './types.js';
|
|
14
14
|
export declare const getNormalizedRspackOptions: (config: RspackOptions) => RspackOptionsNormalized;
|
|
15
15
|
export type EntryDynamicNormalized = () => Promise<EntryStaticNormalized>;
|
|
16
16
|
export type EntryNormalized = EntryDynamicNormalized | EntryStaticNormalized;
|
|
@@ -82,7 +82,7 @@ export interface ModuleOptionsNormalized {
|
|
|
82
82
|
export type CacheSnapshotNormalized = SnapshotOptions;
|
|
83
83
|
export type CacheNormalized = false | {
|
|
84
84
|
type: 'memory';
|
|
85
|
-
} |
|
|
85
|
+
} | {
|
|
86
86
|
type: 'persistent';
|
|
87
87
|
name?: string;
|
|
88
88
|
buildDependencies: string[];
|
package/dist/config/target.d.ts
CHANGED
|
@@ -81,10 +81,16 @@ export type EcmaTargetProperties = {
|
|
|
81
81
|
optionalChaining: boolean | null;
|
|
82
82
|
/** logical assignment is available */
|
|
83
83
|
logicalAssignment: boolean | null;
|
|
84
|
+
/** spread and rest in array/object literals and calls is available */
|
|
85
|
+
spread: boolean | null;
|
|
86
|
+
/** Symbol and well-known symbols are available */
|
|
87
|
+
symbol: boolean | null;
|
|
84
88
|
/** template literal is available */
|
|
85
89
|
templateLiteral: boolean | null;
|
|
86
90
|
/** async functions and await are available */
|
|
87
91
|
asyncFunction: boolean | null;
|
|
92
|
+
/** top-level await is available */
|
|
93
|
+
topLevelAwait: boolean | null;
|
|
88
94
|
};
|
|
89
95
|
export type ExtractedTargetProperties = {
|
|
90
96
|
esVersion?: number | null;
|