@rspack/core 0.6.5 → 0.7.0-beta.0-canary-bcf6575-20240516085135
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/dist/Chunk.d.ts +1 -1
- package/dist/Chunk.js +1 -1
- package/dist/ChunkGroup.d.ts +2 -0
- package/dist/ChunkGroup.js +4 -0
- package/dist/Compilation.d.ts +46 -65
- package/dist/Compilation.js +128 -222
- package/dist/Compiler.d.ts +75 -44
- package/dist/Compiler.js +325 -278
- package/dist/ContextModuleFactory.d.ts +7 -3
- package/dist/ContextModuleFactory.js +2 -2
- package/dist/Entrypoint.d.ts +1 -1
- package/dist/Entrypoint.js +1 -1
- package/dist/ExecuteModulePlugin.js +1 -1
- package/dist/Module.d.ts +11 -0
- package/dist/Module.js +2 -2
- package/dist/MultiCompiler.d.ts +10 -25
- package/dist/MultiCompiler.js +3 -3
- package/dist/MultiStats.d.ts +1 -1
- package/dist/NormalModuleFactory.d.ts +1 -1
- package/dist/Stats.d.ts +2 -2
- package/dist/Watching.d.ts +0 -9
- package/dist/Watching.js +12 -2
- package/dist/builtin-loader/swc/index.d.ts +6 -6
- package/dist/builtin-loader/swc/index.js +3 -3
- package/dist/builtin-loader/swc/types.d.ts +2 -2
- package/dist/builtin-plugin/APIPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ArrayPushCallbackChunkFormatPlugin.d.ts +1 -1
- package/dist/builtin-plugin/AssetModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/AsyncWebAssemblyModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/BannerPlugin.d.ts +2 -2
- package/dist/builtin-plugin/BannerPlugin.js +1 -1
- package/dist/builtin-plugin/BundlerInfoRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ChunkPrefetchPreloadPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CommonJsChunkFormatPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CopyRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CssModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DataUriPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DefinePlugin.d.ts +1 -1
- package/dist/builtin-plugin/DeterministicChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DeterministicModuleIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DynamicEntryPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DynamicEntryPlugin.js +1 -1
- package/dist/builtin-plugin/ElectronTargetPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EnableLibraryPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EnableWasmLoadingPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EnsureChunkConditionsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EntryPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EntryPlugin.js +1 -1
- package/dist/builtin-plugin/EvalDevToolModulePlugin.d.ts +1 -1
- package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ExternalsPlugin.d.ts +3 -3
- package/dist/builtin-plugin/FileUriPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FlagDependencyExportsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FlagDependencyUsagePlugin.d.ts +1 -1
- package/dist/builtin-plugin/HtmlRspackPlugin.d.ts +2 -2
- package/dist/builtin-plugin/HtmlRspackPlugin.js +2 -2
- package/dist/builtin-plugin/HttpExternalsRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/IgnorePlugin.d.ts +1 -1
- package/dist/builtin-plugin/InferAsyncModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/JsLoaderRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/JsLoaderRspackPlugin.js +1 -1
- package/dist/builtin-plugin/JsonModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/LimitChunkCountPlugin.d.ts +1 -1
- package/dist/builtin-plugin/MangleExportsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/MergeDuplicateChunksPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ModuleChunkFormatPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ModuleConcatenationPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NamedChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NamedModuleIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NodeTargetPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ProgressPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ProvidePlugin.d.ts +1 -1
- package/dist/builtin-plugin/RealContentHashPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RemoveEmptyChunksPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RuntimePlugin.d.ts +1 -1
- package/dist/builtin-plugin/SideEffectsFlagPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SizeLimitsPlugin.d.ts +15 -0
- package/dist/builtin-plugin/SizeLimitsPlugin.js +9 -0
- package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SplitChunksPlugin.d.ts +2 -2
- package/dist/builtin-plugin/SplitChunksPlugin.js +4 -4
- package/dist/builtin-plugin/SwcCssMinimizerPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +1 -1
- package/dist/builtin-plugin/WarnCaseSensitiveModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/WebWorkerTemplatePlugin.d.ts +1 -1
- package/dist/builtin-plugin/WorkerPlugin.d.ts +2 -2
- package/dist/builtin-plugin/base.d.ts +1 -1
- package/dist/builtin-plugin/css-extract/index.d.ts +5 -4
- package/dist/builtin-plugin/css-extract/loader.d.ts +1 -1
- package/dist/builtin-plugin/css-extract/loader.js +2 -2
- package/dist/builtin-plugin/index.d.ts +44 -43
- package/dist/builtin-plugin/index.js +44 -43
- package/dist/config/adapter.d.ts +2 -2
- package/dist/config/adapter.js +6 -5
- package/dist/config/adapterRuleUse.d.ts +2 -1
- package/dist/config/adapterRuleUse.js +2 -2
- package/dist/config/defaults.js +21 -4
- package/dist/config/index.d.ts +2 -2
- package/dist/config/index.js +2 -2
- package/dist/config/normalization.d.ts +2 -2
- package/dist/config/normalization.js +1 -0
- package/dist/config/zod.d.ts +317 -189
- package/dist/config/zod.js +23 -29
- package/dist/container/ContainerPlugin.d.ts +1 -1
- package/dist/container/ContainerReferencePlugin.d.ts +1 -1
- package/dist/container/ContainerReferencePlugin.js +1 -1
- package/dist/container/ModuleFederationPlugin.js +1 -1
- package/dist/container/ModuleFederationPluginV1.d.ts +1 -1
- package/dist/container/ModuleFederationPluginV1.js +1 -1
- package/dist/container/ModuleFederationRuntimePlugin.d.ts +1 -1
- package/dist/exports.d.ts +36 -30
- package/dist/exports.js +36 -28
- package/dist/fileSystem.d.ts +12 -8
- package/dist/fileSystem.js +25 -48
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/lite-tapable/index.d.ts +6 -0
- package/dist/lite-tapable/index.js +107 -1
- package/dist/loader-runner/index.js +13 -13
- package/dist/logging/Logger.d.ts +1 -1
- package/dist/logging/createConsoleLogger.js +0 -14
- package/dist/node/NodeEnvironmentPlugin.d.ts +1 -1
- package/dist/node/NodeEnvironmentPlugin.js +1 -1
- package/dist/node/nodeConsole.js +0 -4
- package/dist/rspack.d.ts +4 -13
- package/dist/rspack.js +8 -8
- package/dist/rspackOptionsApply.d.ts +1 -10
- package/dist/rspackOptionsApply.js +17 -5
- package/dist/sharing/ConsumeSharedPlugin.d.ts +1 -1
- package/dist/sharing/ConsumeSharedPlugin.js +1 -1
- package/dist/stats/DefaultStatsFactoryPlugin.js +2 -2
- package/dist/stats/StatsFactory.d.ts +2 -2
- package/dist/stats/StatsFactory.js +0 -9
- package/dist/stats/StatsPrinter.d.ts +1 -1
- package/dist/stats/statsFactoryUtils.d.ts +1 -1
- package/dist/util/comparators.d.ts +1 -1
- package/dist/util/fs.d.ts +64 -0
- package/dist/util/fs.js +122 -0
- package/dist/util/index.d.ts +2 -1
- package/dist/util/index.js +16 -11
- package/dist/util/source.d.ts +18 -0
- package/dist/util/source.js +66 -0
- package/package.json +6 -5
- package/dist/util/createSource.d.ts +0 -5
- package/dist/util/createSource.js +0 -65
package/dist/Compiler.d.ts
CHANGED
|
@@ -10,23 +10,25 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import * as binding from "@rspack/binding";
|
|
12
12
|
import * as tapable from "tapable";
|
|
13
|
-
import * as liteTapable from "./lite-tapable";
|
|
14
13
|
import { Callback } from "tapable";
|
|
15
14
|
import type Watchpack from "../compiled/watchpack";
|
|
15
|
+
import { Compilation, CompilationParams } from "./Compilation";
|
|
16
16
|
import { EntryNormalized, OutputNormalized, RspackOptionsNormalized, RspackPluginInstance } from "./config";
|
|
17
|
+
import { ContextModuleFactory } from "./ContextModuleFactory";
|
|
18
|
+
import { rspack } from "./index";
|
|
19
|
+
import * as liteTapable from "./lite-tapable";
|
|
17
20
|
import { RuleSetCompiler } from "./RuleSetCompiler";
|
|
18
21
|
import { Stats } from "./Stats";
|
|
19
|
-
import { Compilation, CompilationParams } from "./Compilation";
|
|
20
|
-
import { ContextModuleFactory } from "./ContextModuleFactory";
|
|
21
22
|
import ResolverFactory = require("./ResolverFactory");
|
|
22
23
|
import Cache = require("./lib/Cache");
|
|
23
24
|
import CacheFacade = require("./lib/CacheFacade");
|
|
25
|
+
import { Source } from "webpack-sources";
|
|
26
|
+
import { Chunk } from "./Chunk";
|
|
27
|
+
import { FileSystemInfoEntry } from "./FileSystemInfo";
|
|
24
28
|
import { Logger } from "./logging/Logger";
|
|
25
29
|
import { NormalModuleFactory } from "./NormalModuleFactory";
|
|
26
|
-
import { WatchFileSystem } from "./util/fs";
|
|
30
|
+
import { OutputFileSystem, WatchFileSystem } from "./util/fs";
|
|
27
31
|
import { Watching } from "./Watching";
|
|
28
|
-
import { FileSystemInfoEntry } from "./FileSystemInfo";
|
|
29
|
-
import { Source } from "webpack-sources";
|
|
30
32
|
export interface AssetEmittedInfo {
|
|
31
33
|
content: Buffer;
|
|
32
34
|
source: Source;
|
|
@@ -36,34 +38,6 @@ export interface AssetEmittedInfo {
|
|
|
36
38
|
}
|
|
37
39
|
declare class Compiler {
|
|
38
40
|
#private;
|
|
39
|
-
webpack: typeof import("./rspack").rspack & typeof import("./exports") & {
|
|
40
|
-
rspack: typeof import("./rspack").rspack & typeof import("./exports") & any;
|
|
41
|
-
webpack: typeof import("./rspack").rspack & typeof import("./exports") & any;
|
|
42
|
-
};
|
|
43
|
-
compilation?: Compilation;
|
|
44
|
-
compilationParams?: CompilationParams;
|
|
45
|
-
builtinPlugins: binding.BuiltinPlugin[];
|
|
46
|
-
root: Compiler;
|
|
47
|
-
running: boolean;
|
|
48
|
-
idle: boolean;
|
|
49
|
-
resolverFactory: ResolverFactory;
|
|
50
|
-
infrastructureLogger: any;
|
|
51
|
-
watching?: Watching;
|
|
52
|
-
outputPath: string;
|
|
53
|
-
name?: string;
|
|
54
|
-
inputFileSystem: any;
|
|
55
|
-
outputFileSystem: typeof import("fs");
|
|
56
|
-
ruleSet: RuleSetCompiler;
|
|
57
|
-
watchFileSystem: WatchFileSystem;
|
|
58
|
-
intermediateFileSystem: any;
|
|
59
|
-
watchMode: boolean;
|
|
60
|
-
context: string;
|
|
61
|
-
cache: Cache;
|
|
62
|
-
compilerPath: string;
|
|
63
|
-
modifiedFiles?: ReadonlySet<string>;
|
|
64
|
-
removedFiles?: ReadonlySet<string>;
|
|
65
|
-
fileTimestamps?: ReadonlyMap<string, FileSystemInfoEntry | "ignore" | null>;
|
|
66
|
-
contextTimestamps?: ReadonlyMap<string, FileSystemInfoEntry | "ignore" | null>;
|
|
67
41
|
hooks: {
|
|
68
42
|
done: tapable.AsyncSeriesHook<Stats>;
|
|
69
43
|
afterDone: tapable.SyncHook<Stats>;
|
|
@@ -95,29 +69,86 @@ declare class Compiler {
|
|
|
95
69
|
finishMake: liteTapable.AsyncSeriesHook<[Compilation]>;
|
|
96
70
|
entryOption: tapable.SyncBailHook<[string, EntryNormalized], any>;
|
|
97
71
|
};
|
|
98
|
-
|
|
72
|
+
webpack: typeof rspack;
|
|
73
|
+
name?: string;
|
|
99
74
|
parentCompilation?: Compilation;
|
|
75
|
+
root: Compiler;
|
|
76
|
+
outputPath: string;
|
|
77
|
+
running: boolean;
|
|
78
|
+
idle: boolean;
|
|
79
|
+
resolverFactory: ResolverFactory;
|
|
80
|
+
infrastructureLogger: any;
|
|
81
|
+
watching?: Watching;
|
|
82
|
+
inputFileSystem: any;
|
|
83
|
+
intermediateFileSystem: any;
|
|
84
|
+
outputFileSystem: OutputFileSystem | null;
|
|
85
|
+
watchFileSystem: WatchFileSystem | null;
|
|
86
|
+
records: Record<string, any[]>;
|
|
87
|
+
modifiedFiles?: ReadonlySet<string>;
|
|
88
|
+
removedFiles?: ReadonlySet<string>;
|
|
89
|
+
fileTimestamps?: ReadonlyMap<string, FileSystemInfoEntry | "ignore" | null>;
|
|
90
|
+
contextTimestamps?: ReadonlyMap<string, FileSystemInfoEntry | "ignore" | null>;
|
|
91
|
+
fsStartTime?: number;
|
|
92
|
+
watchMode: boolean;
|
|
93
|
+
context: string;
|
|
94
|
+
cache: Cache;
|
|
95
|
+
compilerPath: string;
|
|
96
|
+
options: RspackOptionsNormalized;
|
|
100
97
|
constructor(context: string, options: RspackOptionsNormalized);
|
|
98
|
+
get recordsInputPath(): never;
|
|
99
|
+
get recordsOutputPath(): never;
|
|
100
|
+
get managedPaths(): never;
|
|
101
|
+
get immutablePaths(): never;
|
|
102
|
+
get _lastCompilation(): Compilation | undefined;
|
|
103
|
+
/**
|
|
104
|
+
* Note: This is not a webpack public API, maybe removed in future.
|
|
105
|
+
* @internal
|
|
106
|
+
*/
|
|
107
|
+
get __internal__builtinPlugins(): binding.BuiltinPlugin[];
|
|
108
|
+
/**
|
|
109
|
+
* Note: This is not a webpack public API, maybe removed in future.
|
|
110
|
+
* @internal
|
|
111
|
+
*/
|
|
112
|
+
get __internal__ruleSet(): RuleSetCompiler;
|
|
101
113
|
/**
|
|
102
114
|
* @param name - cache name
|
|
103
115
|
* @returns the cache facade instance
|
|
104
116
|
*/
|
|
105
117
|
getCache(name: string): CacheFacade;
|
|
118
|
+
/**
|
|
119
|
+
* @param name - name of the logger, or function called once to get the logger name
|
|
120
|
+
* @returns a logger with that name
|
|
121
|
+
*/
|
|
122
|
+
getInfrastructureLogger(name: string | (() => string)): Logger;
|
|
123
|
+
/**
|
|
124
|
+
* @param watchOptions - the watcher's options
|
|
125
|
+
* @param handler - signals when the call finishes
|
|
126
|
+
* @returns a compiler watcher
|
|
127
|
+
*/
|
|
128
|
+
watch(watchOptions: Watchpack.WatchOptions, handler: Callback<Error, Stats>): Watching;
|
|
129
|
+
/**
|
|
130
|
+
* @param callback - signals when the call finishes
|
|
131
|
+
*/
|
|
132
|
+
run(callback: Callback<Error, Stats>): void;
|
|
133
|
+
runAsChild(callback: (err?: null | Error, entries?: Chunk[], compilation?: Compilation) => any): void;
|
|
134
|
+
purgeInputFileSystem(): void;
|
|
135
|
+
/**
|
|
136
|
+
* @param compilation - the compilation
|
|
137
|
+
* @param compilerName - the compiler's name
|
|
138
|
+
* @param compilerIndex - the compiler's index
|
|
139
|
+
* @param outputOptions - the output options
|
|
140
|
+
* @param plugins - the plugins to apply
|
|
141
|
+
* @returns a child compiler
|
|
142
|
+
*/
|
|
106
143
|
createChildCompiler(compilation: Compilation, compilerName: string, compilerIndex: number, outputOptions: OutputNormalized, plugins: RspackPluginInstance[]): Compiler;
|
|
107
|
-
runAsChild(callback: any): void;
|
|
108
144
|
isChild(): boolean;
|
|
109
|
-
|
|
110
|
-
|
|
145
|
+
compile(callback: Callback<Error, Compilation>): void;
|
|
146
|
+
close(callback: (error?: Error | null) => void): void;
|
|
111
147
|
/**
|
|
112
|
-
*
|
|
148
|
+
* Note: This is not a webpack public API, maybe removed in future.
|
|
113
149
|
* @internal
|
|
114
150
|
*/
|
|
115
151
|
__internal__rebuild(modifiedFiles?: ReadonlySet<string>, removedFiles?: ReadonlySet<string>, callback?: (error: Error | null) => void): void;
|
|
116
|
-
compile(callback: Callback<Error, Compilation>): void;
|
|
117
|
-
watch(watchOptions: Watchpack.WatchOptions, handler: Callback<Error, Stats>): Watching;
|
|
118
|
-
purgeInputFileSystem(): void;
|
|
119
|
-
close(callback: (error?: Error | null) => void): void;
|
|
120
|
-
getAsset(name: string): Buffer | null;
|
|
121
152
|
__internal__registerBuiltinPlugin(plugin: binding.BuiltinPlugin): void;
|
|
122
153
|
__internal__getModuleExecutionResult(id: number): any;
|
|
123
154
|
}
|