@rspack-canary/browser 1.4.12-canary-becf0a0e-20250808091433 → 1.4.12-canary-51b82a4d-20250815075104
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/Compiler.d.ts +5 -0
- package/dist/Module.d.ts +3 -14
- package/dist/NativeWatchFileSystem.d.ts +1 -0
- package/dist/VirtualModulesPlugin.d.ts +12 -0
- package/dist/browser/fs.d.ts +6 -6
- package/dist/builtin-plugin/NormalModuleReplacementPlugin.d.ts +10 -0
- package/dist/builtin-plugin/index.d.ts +1 -0
- package/dist/config/normalization.d.ts +6 -0
- package/dist/config/types.d.ts +11 -0
- package/dist/exports.d.ts +3 -2
- package/dist/index.mjs +361 -291
- package/dist/rspack.wasi-browser.js +2 -0
- package/dist/rspack.wasm32-wasi.wasm +0 -0
- package/dist/schema/config.d.ts +12 -0
- package/package.json +3 -3
- package/dist/lib/NormalModuleReplacementPlugin.d.ts +0 -29
package/dist/Compiler.d.ts
CHANGED
|
@@ -163,6 +163,11 @@ declare class Compiler {
|
|
|
163
163
|
* @internal
|
|
164
164
|
*/
|
|
165
165
|
__internal__create_compilation(native: binding.JsCompilation): Compilation;
|
|
166
|
+
/**
|
|
167
|
+
* Note: This is not a webpack public API, maybe removed in future.
|
|
168
|
+
* @internal
|
|
169
|
+
*/
|
|
170
|
+
__internal__get_virtual_file_store(): binding.VirtualFileStore | null | undefined;
|
|
166
171
|
/**
|
|
167
172
|
* Note: This is not a webpack public API, maybe removed in future.
|
|
168
173
|
* @internal
|
package/dist/Module.d.ts
CHANGED
|
@@ -5,20 +5,9 @@ import "./BuildInfo";
|
|
|
5
5
|
export type ResourceDataWithData = ResourceData & {
|
|
6
6
|
data?: Record<string, any>;
|
|
7
7
|
};
|
|
8
|
-
export type CreateData =
|
|
9
|
-
export type ContextInfo =
|
|
10
|
-
|
|
11
|
-
issuerLayer?: string | null;
|
|
12
|
-
};
|
|
13
|
-
export type ResolveData = {
|
|
14
|
-
contextInfo: ContextInfo;
|
|
15
|
-
context: string;
|
|
16
|
-
request: string;
|
|
17
|
-
fileDependencies: string[];
|
|
18
|
-
missingDependencies: string[];
|
|
19
|
-
contextDependencies: string[];
|
|
20
|
-
createData?: CreateData;
|
|
21
|
-
};
|
|
8
|
+
export type CreateData = binding.JsCreateData;
|
|
9
|
+
export type ContextInfo = binding.ContextInfo;
|
|
10
|
+
export type ResolveData = binding.JsResolveData;
|
|
22
11
|
export declare class ContextModuleFactoryBeforeResolveData {
|
|
23
12
|
#private;
|
|
24
13
|
context: string;
|
|
@@ -15,4 +15,5 @@ export default class NativeWatchFileSystem implements WatchFileSystem {
|
|
|
15
15
|
removed?: Iterable<string>;
|
|
16
16
|
}, _startTime: number, options: Watchpack.WatchOptions, callback: (error: Error | null, fileTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">, contextTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">, changedFiles: Set<string>, removedFiles: Set<string>) => void, callbackUndelayed: (fileName: string, changeTime: number) => void): Watcher;
|
|
17
17
|
getNativeWatcher(options: Watchpack.WatchOptions): binding.NativeWatcher;
|
|
18
|
+
triggerEvent(kind: "change" | "remove" | "create", path: string): void;
|
|
18
19
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Compiler } from "./Compiler";
|
|
2
|
+
export declare class VirtualModulesPlugin {
|
|
3
|
+
#private;
|
|
4
|
+
constructor(modules?: Record<string, string>);
|
|
5
|
+
apply(compiler: Compiler): void;
|
|
6
|
+
writeModule(filePath: string, contents: string): void;
|
|
7
|
+
private getVirtualFileStore;
|
|
8
|
+
static __internal__take_virtual_files(compiler: Compiler): {
|
|
9
|
+
path: string;
|
|
10
|
+
content: string;
|
|
11
|
+
}[] | undefined;
|
|
12
|
+
}
|
package/dist/browser/fs.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { IFs, Volume } from "memfs";
|
|
2
2
|
export declare const fs: IFs;
|
|
3
3
|
export declare const volume: Volume;
|
|
4
|
-
declare const readFileSync: (file: import("memfs/lib/
|
|
5
|
-
(path: import("memfs/lib/node/types/misc").PathLike, callback: import("memfs/lib/
|
|
6
|
-
(path: import("memfs/lib/node/types/misc").PathLike, options: import("memfs/lib/node/types/options").IStatOptions, callback: import("memfs/lib/
|
|
4
|
+
declare const readFileSync: (file: import("memfs/lib/core").TFileId, options?: import("memfs/lib/node/types/options").IReadFileOptions | string) => import("memfs/lib/encoding").TDataOut, readdirSync: (path: import("memfs/lib/node/types/misc").PathLike, options?: import("memfs/lib/node/types/options").IReaddirOptions | string) => import("memfs/lib/encoding").TDataOut[] | import("memfs/lib/node/Dirent").Dirent[], lstat: {
|
|
5
|
+
(path: import("memfs/lib/node/types/misc").PathLike, callback: import("memfs/lib/node/types/misc").TCallback<import("memfs/lib/node/Stats").Stats>): void;
|
|
6
|
+
(path: import("memfs/lib/node/types/misc").PathLike, options: import("memfs/lib/node/types/options").IStatOptions, callback: import("memfs/lib/node/types/misc").TCallback<import("memfs/lib/node/Stats").Stats>): void;
|
|
7
7
|
}, existsSync: (path: import("memfs/lib/node/types/misc").PathLike) => boolean, readdir: {
|
|
8
|
-
(path: import("memfs/lib/node/types/misc").PathLike, callback: import("memfs/lib/
|
|
9
|
-
(path: import("memfs/lib/node/types/misc").PathLike, options: import("memfs/lib/node/types/options").IReaddirOptions | string, callback: import("memfs/lib/
|
|
10
|
-
}, watch: (path: import("memfs/lib/node/types/misc").PathLike, options?: import("memfs/lib/volume").IWatchOptions | string, listener?: (eventType: string, filename: string) => void) => import("memfs/lib/volume").FSWatcher;
|
|
8
|
+
(path: import("memfs/lib/node/types/misc").PathLike, callback: import("memfs/lib/node/types/misc").TCallback<import("memfs/lib/encoding").TDataOut[] | import("memfs/lib/node/Dirent").Dirent[]>): any;
|
|
9
|
+
(path: import("memfs/lib/node/types/misc").PathLike, options: import("memfs/lib/node/types/options").IReaddirOptions | string, callback: import("memfs/lib/node/types/misc").TCallback<import("memfs/lib/encoding").TDataOut[] | import("memfs/lib/node/Dirent").Dirent[]>): any;
|
|
10
|
+
}, watch: (path: import("memfs/lib/node/types/misc").PathLike, options?: import("memfs/lib/node/volume").IWatchOptions | string, listener?: (eventType: string, filename: string) => void) => import("memfs/lib/node/volume").FSWatcher;
|
|
11
11
|
export default fs;
|
|
12
12
|
export { readFileSync, readdirSync, lstat, existsSync, readdir, watch };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ResolveData } from "../Module";
|
|
2
|
+
export declare const NormalModuleReplacementPlugin: {
|
|
3
|
+
new (resourceRegExp: RegExp, newResource: string | ((data: ResolveData) => void)): {
|
|
4
|
+
name: string;
|
|
5
|
+
_args: [resourceRegExp: RegExp, newResource: string | ((data: ResolveData) => void)];
|
|
6
|
+
affectedHooks: "done" | "compilation" | "run" | "afterDone" | "thisCompilation" | "invalid" | "compile" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "emit" | "assetEmitted" | "afterEmit" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "make" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | "additionalPass" | undefined;
|
|
7
|
+
raw(compiler: import("..").Compiler): import("@rspack/binding").BuiltinPlugin;
|
|
8
|
+
apply(compiler: import("..").Compiler): void;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
@@ -58,6 +58,7 @@ export * from "./NaturalChunkIdsPlugin";
|
|
|
58
58
|
export * from "./NaturalModuleIdsPlugin";
|
|
59
59
|
export * from "./NodeTargetPlugin";
|
|
60
60
|
export * from "./NoEmitOnErrorsPlugin";
|
|
61
|
+
export * from "./NormalModuleReplacementPlugin";
|
|
61
62
|
export * from "./OccurrenceChunkIdsPlugin";
|
|
62
63
|
export * from "./ProgressPlugin";
|
|
63
64
|
export * from "./ProvidePlugin";
|
|
@@ -95,6 +95,11 @@ export type ExperimentCacheNormalized = boolean | {
|
|
|
95
95
|
};
|
|
96
96
|
export interface ExperimentsNormalized {
|
|
97
97
|
cache?: ExperimentCacheNormalized;
|
|
98
|
+
/**
|
|
99
|
+
* @deprecated This option is deprecated and will be removed in future versions.
|
|
100
|
+
*
|
|
101
|
+
* Please use the Configuration top-level `lazyCompilation` option instead.
|
|
102
|
+
*/
|
|
98
103
|
lazyCompilation?: false | LazyCompilationOptions;
|
|
99
104
|
asyncWebAssembly?: boolean;
|
|
100
105
|
outputModule?: boolean;
|
|
@@ -144,6 +149,7 @@ export interface RspackOptionsNormalized {
|
|
|
144
149
|
optimization: Optimization;
|
|
145
150
|
plugins: Plugins;
|
|
146
151
|
experiments: ExperimentsNormalized;
|
|
152
|
+
lazyCompilation?: false | LazyCompilationOptions;
|
|
147
153
|
watch?: Watch;
|
|
148
154
|
watchOptions: WatchOptions;
|
|
149
155
|
devServer?: DevServer;
|
package/dist/config/types.d.ts
CHANGED
|
@@ -763,6 +763,11 @@ export type JavascriptParserOptions = {
|
|
|
763
763
|
* @default true
|
|
764
764
|
* */
|
|
765
765
|
exprContextCritical?: boolean;
|
|
766
|
+
/**
|
|
767
|
+
* Enable warnings for unknown dynamic dependencies
|
|
768
|
+
* @default true
|
|
769
|
+
* */
|
|
770
|
+
unknownContextCritical?: boolean;
|
|
766
771
|
/**
|
|
767
772
|
* Enable warnings for partial dynamic dependencies
|
|
768
773
|
* @default false
|
|
@@ -1971,6 +1976,7 @@ export type Experiments = {
|
|
|
1971
1976
|
cache?: ExperimentCacheOptions;
|
|
1972
1977
|
/**
|
|
1973
1978
|
* Enable lazy compilation.
|
|
1979
|
+
* @deprecated Please use the configuration top-level `lazyCompilation` option instead.
|
|
1974
1980
|
* @default false
|
|
1975
1981
|
*/
|
|
1976
1982
|
lazyCompilation?: boolean | LazyCompilationOptions;
|
|
@@ -2282,6 +2288,11 @@ export type RspackOptions = {
|
|
|
2282
2288
|
* Performance optimization options.
|
|
2283
2289
|
*/
|
|
2284
2290
|
performance?: Performance;
|
|
2291
|
+
/**
|
|
2292
|
+
* Enable lazy compilation.
|
|
2293
|
+
* @default false
|
|
2294
|
+
*/
|
|
2295
|
+
lazyCompilation?: boolean | LazyCompilationOptions;
|
|
2285
2296
|
};
|
|
2286
2297
|
/** Configuration for Rspack */
|
|
2287
2298
|
export type Configuration = RspackOptions;
|
package/dist/exports.d.ts
CHANGED
|
@@ -56,7 +56,6 @@ export { default as EntryOptionPlugin } from "./lib/EntryOptionPlugin";
|
|
|
56
56
|
export { EnvironmentPlugin } from "./lib/EnvironmentPlugin";
|
|
57
57
|
export { LoaderOptionsPlugin } from "./lib/LoaderOptionsPlugin";
|
|
58
58
|
export { LoaderTargetPlugin } from "./lib/LoaderTargetPlugin";
|
|
59
|
-
export { NormalModuleReplacementPlugin } from "./lib/NormalModuleReplacementPlugin";
|
|
60
59
|
export type { OutputFileSystem } from "./util/fs";
|
|
61
60
|
import { FetchCompileAsyncWasmPlugin, lazyCompilationMiddleware, SubresourceIntegrityPlugin } from "./builtin-plugin";
|
|
62
61
|
interface Web {
|
|
@@ -133,10 +132,11 @@ export declare const sharing: {
|
|
|
133
132
|
export type { FeatureOptions as LightningcssFeatureOptions, LoaderOptions as LightningcssLoaderOptions } from "./builtin-loader/lightningcss/index";
|
|
134
133
|
export type { SwcLoaderEnvConfig, SwcLoaderEsParserConfig, SwcLoaderJscConfig, SwcLoaderModuleConfig, SwcLoaderOptions, SwcLoaderParserConfig, SwcLoaderTransformConfig, SwcLoaderTsParserConfig } from "./builtin-loader/swc/index";
|
|
135
134
|
export type { CircularDependencyRspackPluginOptions, CopyRspackPluginOptions, CssExtractRspackLoaderOptions, CssExtractRspackPluginOptions, EvalDevToolModulePluginOptions, HtmlRspackPluginOptions, LightningCssMinimizerRspackPluginOptions, RsdoctorPluginData, RsdoctorPluginHooks, SourceMapDevToolPluginOptions, SubresourceIntegrityPluginOptions, SwcJsMinimizerRspackPluginOptions } from "./builtin-plugin";
|
|
136
|
-
export { CircularDependencyRspackPlugin, ContextReplacementPlugin, CopyRspackPlugin, CssExtractRspackPlugin, EvalDevToolModulePlugin, EvalSourceMapDevToolPlugin, HtmlRspackPlugin, LightningCssMinimizerRspackPlugin, SourceMapDevToolPlugin, SwcJsMinimizerRspackPlugin } from "./builtin-plugin";
|
|
135
|
+
export { CircularDependencyRspackPlugin, ContextReplacementPlugin, CopyRspackPlugin, CssExtractRspackPlugin, EvalDevToolModulePlugin, EvalSourceMapDevToolPlugin, HtmlRspackPlugin, LightningCssMinimizerRspackPlugin, NormalModuleReplacementPlugin, SourceMapDevToolPlugin, SwcJsMinimizerRspackPlugin } from "./builtin-plugin";
|
|
137
136
|
import { EnforceExtension, ResolverFactory, async as resolveAsync, sync as resolveSync } from "@rspack/binding";
|
|
138
137
|
import { createNativePlugin } from "./builtin-plugin";
|
|
139
138
|
import { minify, minifySync, transform, transformSync } from "./swc";
|
|
139
|
+
import { VirtualModulesPlugin } from "./VirtualModulesPlugin";
|
|
140
140
|
interface Experiments {
|
|
141
141
|
globalTrace: {
|
|
142
142
|
register: (filter: string, layer: "logger" | "perfetto", output: string) => Promise<void>;
|
|
@@ -162,5 +162,6 @@ interface Experiments {
|
|
|
162
162
|
};
|
|
163
163
|
CssChunkingPlugin: typeof CssChunkingPlugin;
|
|
164
164
|
createNativePlugin: typeof createNativePlugin;
|
|
165
|
+
VirtualModulesPlugin: typeof VirtualModulesPlugin;
|
|
165
166
|
}
|
|
166
167
|
export declare const experiments: Experiments;
|