@rspack-debug/browser 2.0.0-canary-20260116 → 2.0.0-rc.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/dist/BuildInfo.d.ts +3 -3
- package/dist/Chunk.d.ts +3 -3
- package/dist/ChunkGraph.d.ts +2 -2
- package/dist/Chunks.d.ts +2 -2
- package/dist/Compilation.d.ts +6 -3
- package/dist/Compiler.d.ts +5 -2
- package/dist/ConcatenatedModule.d.ts +1 -1
- package/dist/ContextModule.d.ts +1 -1
- package/dist/Diagnostics.d.ts +1 -1
- package/dist/Entrypoint.d.ts +1 -1
- package/dist/ExportsInfo.d.ts +1 -1
- package/dist/ExternalModule.d.ts +1 -1
- package/dist/FileSystem.d.ts +2 -2
- package/dist/Module.d.ts +3 -3
- package/dist/ModuleGraph.d.ts +2 -1
- package/dist/NativeWatchFileSystem.d.ts +1 -1
- package/dist/NormalModule.d.ts +2 -3
- package/dist/NormalModuleFactory.d.ts +1 -1
- package/dist/Resolver.d.ts +1 -1
- package/dist/ResolverFactory.d.ts +1 -1
- package/dist/RspackError.d.ts +2 -2
- package/dist/RuntimeGlobals.d.ts +2 -2
- package/dist/RuntimeModule.d.ts +1 -1
- package/dist/browser/BrowserRequirePlugin.d.ts +1 -1
- package/dist/browser/fs.d.ts +1 -1
- package/dist/browser/middleware.d.ts +1 -0
- package/dist/builtin-loader/lightningcss/index.d.ts +11 -9
- package/dist/builtin-loader/lightningcss/target.d.ts +4 -0
- package/dist/builtin-loader/swc/index.d.ts +2 -2
- package/dist/builtin-loader/swc/pluginImport.d.ts +1 -1
- package/dist/builtin-loader/swc/types.d.ts +36 -1
- package/dist/builtin-plugin/BannerPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CircularDependencyRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CopyRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CssChunkingPlugin.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/DllReferenceAgencyPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DynamicEntryPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EnableLibraryPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EntryPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EsmLibraryPlugin.d.ts +5 -1
- package/dist/builtin-plugin/EsmNodeTargetPlugin.d.ts +9 -0
- 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 +1 -1
- package/dist/builtin-plugin/FlagDependencyUsagePlugin.d.ts +1 -1
- package/dist/builtin-plugin/HotModuleReplacementPlugin.d.ts +1 -1
- package/dist/builtin-plugin/HttpUriPlugin.d.ts +1 -1
- package/dist/builtin-plugin/IgnorePlugin.d.ts +1 -1
- package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/LightningCssMinimizerRspackPlugin.d.ts +5 -4
- package/dist/builtin-plugin/MangleExportsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ModuleConcatenationPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NaturalChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NaturalModuleIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/OccurrenceChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ProgressPlugin.d.ts +5 -4
- package/dist/builtin-plugin/RsdoctorPlugin.d.ts +2 -2
- package/dist/builtin-plugin/RslibPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RstestPlugin.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/SourceMapDevToolPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SplitChunksPlugin.d.ts +2 -1
- package/dist/builtin-plugin/SubresourceIntegrityPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +3 -2
- package/dist/builtin-plugin/WebWorkerTemplatePlugin.d.ts +1 -1
- package/dist/builtin-plugin/WorkerPlugin.d.ts +2 -1
- package/dist/builtin-plugin/base.d.ts +1 -1
- package/dist/builtin-plugin/css-extract/index.d.ts +1 -1
- package/dist/builtin-plugin/html-plugin/hooks.d.ts +1 -1
- package/dist/builtin-plugin/html-plugin/plugin.d.ts +1 -1
- package/dist/builtin-plugin/index.d.ts +2 -0
- package/dist/builtin-plugin/lazy-compilation/middleware.d.ts +3 -3
- package/dist/builtin-plugin/rsc/Coordinator.d.ts +8 -0
- package/dist/builtin-plugin/rsc/RscClientPlugin.d.ts +13 -0
- package/dist/builtin-plugin/rsc/RscServerPlugin.d.ts +39 -0
- package/dist/builtin-plugin/rsc/index.d.ts +24 -0
- package/dist/checkNodeVersion.d.ts +1 -0
- package/dist/config/adapter.d.ts +1 -1
- package/dist/config/adapterRuleUse.d.ts +3 -2
- package/dist/config/defaults.d.ts +4 -2
- package/dist/config/devServer.d.ts +102 -237
- package/dist/config/normalization.d.ts +2 -3
- package/dist/config/target.d.ts +14 -11
- package/dist/config/types.d.ts +152 -63
- package/dist/container/ContainerPlugin.d.ts +4 -3
- package/dist/container/ContainerReferencePlugin.d.ts +5 -4
- package/dist/container/ModuleFederationManifestPlugin.d.ts +11 -4
- package/dist/container/ModuleFederationPlugin.d.ts +20 -1
- package/dist/container/ModuleFederationPluginV1.d.ts +2 -2
- package/dist/container/ModuleFederationRuntimePlugin.d.ts +4 -0
- package/dist/exports.d.ts +13 -10
- package/dist/index.d.ts +2 -1
- package/dist/index.js +43927 -8544
- package/dist/index.js.LICENSE.txt +7 -0
- package/dist/lib/DllReferencePlugin.d.ts +1 -1
- package/dist/lib/WebpackError.d.ts +1 -1
- package/dist/loader-runner/index.d.ts +1 -1
- package/dist/loader-runner/worker.d.ts +1 -1
- package/dist/napi-binding.d.ts +248 -101
- package/dist/rspack.wasi-browser.js +7 -0
- package/dist/sharing/CollectSharedEntryPlugin.d.ts +22 -0
- package/dist/sharing/ConsumeSharedPlugin.d.ts +17 -4
- package/dist/sharing/IndependentSharedPlugin.d.ts +35 -0
- package/dist/sharing/ProvideSharedPlugin.d.ts +23 -3
- package/dist/sharing/SharePlugin.d.ts +43 -5
- package/dist/sharing/ShareRuntimePlugin.d.ts +1 -1
- package/dist/sharing/SharedContainerPlugin.d.ts +23 -0
- package/dist/sharing/SharedUsedExportsOptimizerPlugin.d.ts +14 -0
- package/dist/sharing/TreeShakingSharedPlugin.d.ts +16 -0
- package/dist/sharing/utils.d.ts +1 -0
- package/dist/stats/StatsFactory.d.ts +1 -1
- package/dist/stats/statsFactoryUtils.d.ts +2 -2
- package/dist/swc.d.ts +2 -2
- package/dist/taps/compilation.d.ts +1 -1
- package/dist/taps/types.d.ts +1 -1
- package/dist/util/SplitChunkSize.d.ts +1 -1
- package/dist/util/createHash.d.ts +1 -1
- package/dist/util/source.d.ts +1 -1
- package/dist/util/supportsColor.d.ts +6 -0
- package/dist/util/targetsVersion.d.ts +2 -0
- package/dist/wasi-worker-browser.mjs +26464 -22498
- package/package.json +6 -7
- package/dist/builtin-loader/index.d.ts +0 -1
- package/dist/rslib-runtime.js +0 -58
package/dist/BuildInfo.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import binding from '
|
|
1
|
+
import binding from './binding';
|
|
2
2
|
import type { Source } from 'webpack-sources';
|
|
3
3
|
declare const $assets: unique symbol;
|
|
4
|
-
declare module '
|
|
4
|
+
declare module './binding' {
|
|
5
5
|
interface Assets {
|
|
6
6
|
[$assets]: Record<string, Source>;
|
|
7
7
|
}
|
|
@@ -13,5 +13,5 @@ declare module '@rspack/binding' {
|
|
|
13
13
|
buildDependencies: Set<string>;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
export type { BuildInfo } from '
|
|
16
|
+
export type { BuildInfo } from './binding';
|
|
17
17
|
export declare const commitCustomFieldsToRust: (buildInfo: binding.BuildInfo) => void;
|
package/dist/Chunk.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { type ChunkGroup } from '
|
|
1
|
+
import { type ChunkGroup } from './binding';
|
|
2
2
|
interface ChunkMaps {
|
|
3
3
|
hash: Record<string | number, string>;
|
|
4
4
|
contentHash: Record<string | number, Record<string, string>>;
|
|
5
5
|
name: Record<string | number, string>;
|
|
6
6
|
}
|
|
7
|
-
declare module '
|
|
7
|
+
declare module './binding' {
|
|
8
8
|
interface Chunk {
|
|
9
9
|
readonly files: ReadonlySet<string>;
|
|
10
10
|
readonly runtime: ReadonlySet<string>;
|
|
@@ -13,4 +13,4 @@ declare module '@rspack/binding' {
|
|
|
13
13
|
getChunkMaps(realHash: boolean): ChunkMaps;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
export { Chunk } from '
|
|
16
|
+
export { Chunk } from './binding';
|
package/dist/ChunkGraph.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { RuntimeSpec } from './util/runtime';
|
|
2
|
-
declare module '
|
|
2
|
+
declare module './binding' {
|
|
3
3
|
interface ChunkGraph {
|
|
4
4
|
getModuleChunksIterable(module: Module): Iterable<Chunk>;
|
|
5
5
|
getOrderedChunkModulesIterable(chunk: Chunk, compareFn: (a: Module, b: Module) => number): Iterable<Module>;
|
|
6
6
|
getModuleHash(module: Module, runtime: RuntimeSpec): string | null;
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
|
-
export { ChunkGraph } from '
|
|
9
|
+
export { ChunkGraph } from './binding';
|
package/dist/Chunks.d.ts
CHANGED
package/dist/Compilation.d.ts
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
* Copyright (c) JS Foundation and other contributors
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
|
-
import type { AssetInfo, ChunkGroup, Dependency, ExternalObject, JsCompilation } from '
|
|
11
|
-
import binding from '
|
|
12
|
-
export type { AssetInfo } from '
|
|
10
|
+
import type { AssetInfo, ChunkGroup, Dependency, ExternalObject, JsCompilation } from './binding';
|
|
11
|
+
import binding from './binding';
|
|
12
|
+
export type { AssetInfo } from './binding';
|
|
13
13
|
import * as liteTapable from '@rspack/lite-tapable';
|
|
14
14
|
import type { Source } from 'webpack-sources';
|
|
15
15
|
import type { EntryOptions, EntryPlugin } from './builtin-plugin';
|
|
@@ -162,6 +162,7 @@ export declare class Compilation {
|
|
|
162
162
|
Iterable<Chunk>,
|
|
163
163
|
Iterable<Module>
|
|
164
164
|
], void>;
|
|
165
|
+
beforeModuleIds: liteTapable.SyncHook<[Iterable<Module>]>;
|
|
165
166
|
finishModules: liteTapable.AsyncSeriesHook<[Iterable<Module>], void>;
|
|
166
167
|
chunkHash: liteTapable.SyncHook<[Chunk, Hash]>;
|
|
167
168
|
chunkAsset: liteTapable.SyncHook<[Chunk, string]>;
|
|
@@ -432,6 +433,8 @@ export declare class Entries implements Map<string, EntryData> {
|
|
|
432
433
|
has(key: string): boolean;
|
|
433
434
|
set(key: string, value: EntryData): this;
|
|
434
435
|
delete(key: string): boolean;
|
|
436
|
+
getOrInsert(key: string, defaultValue: EntryData): EntryData;
|
|
437
|
+
getOrInsertComputed(key: string, callback: (key: string) => EntryData): EntryData;
|
|
435
438
|
get(key: string): EntryData | undefined;
|
|
436
439
|
keys(): ReturnType<Map<string, EntryData>['keys']>;
|
|
437
440
|
}
|
package/dist/Compiler.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Copyright (c) JS Foundation and other contributors
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
|
-
import type binding from '
|
|
10
|
+
import type binding from './binding';
|
|
11
11
|
import * as liteTapable from '@rspack/lite-tapable';
|
|
12
12
|
import type Watchpack from 'watchpack';
|
|
13
13
|
import type { Source } from 'webpack-sources';
|
|
@@ -16,7 +16,7 @@ import type { CompilationParams } from './Compilation';
|
|
|
16
16
|
import { Compilation } from './Compilation';
|
|
17
17
|
import { ContextModuleFactory } from './ContextModuleFactory';
|
|
18
18
|
import type { EntryNormalized, OutputNormalized, RspackOptionsNormalized, RspackPluginInstance } from './config';
|
|
19
|
-
import type { PlatformTargetProperties } from './config/target';
|
|
19
|
+
import type { ExtractedTargetProperties, PlatformTargetProperties } from './config/target';
|
|
20
20
|
import type { FileSystemInfoEntry } from './FileSystemInfo';
|
|
21
21
|
import type { rspack } from './index';
|
|
22
22
|
import Cache from './lib/Cache';
|
|
@@ -79,6 +79,7 @@ export type CompilerHooks = {
|
|
|
79
79
|
entryOption: liteTapable.SyncBailHook<[string, EntryNormalized], any>;
|
|
80
80
|
additionalPass: liteTapable.AsyncSeriesHook<[]>;
|
|
81
81
|
};
|
|
82
|
+
export declare const GET_COMPILER_ID: unique symbol;
|
|
82
83
|
declare class Compiler {
|
|
83
84
|
#private;
|
|
84
85
|
hooks: CompilerHooks;
|
|
@@ -129,6 +130,8 @@ declare class Compiler {
|
|
|
129
130
|
get _lastCompilation(): Compilation | undefined;
|
|
130
131
|
get platform(): PlatformTargetProperties;
|
|
131
132
|
set platform(platform: PlatformTargetProperties);
|
|
133
|
+
get target(): ExtractedTargetProperties;
|
|
134
|
+
set target(target: ExtractedTargetProperties);
|
|
132
135
|
/**
|
|
133
136
|
* Note: This is not a webpack public API, maybe removed in future.
|
|
134
137
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ConcatenatedModule } from '
|
|
1
|
+
export { ConcatenatedModule } from './binding';
|
package/dist/ContextModule.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ContextModule } from '
|
|
1
|
+
export { ContextModule } from './binding';
|
package/dist/Diagnostics.d.ts
CHANGED
package/dist/Entrypoint.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ChunkGroup } from '
|
|
1
|
+
import type { ChunkGroup } from './binding';
|
|
2
2
|
export type Entrypoint = ChunkGroup;
|
package/dist/ExportsInfo.d.ts
CHANGED
package/dist/ExternalModule.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ExternalModule } from '
|
|
1
|
+
export { ExternalModule } from './binding';
|
package/dist/FileSystem.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { NodeFsStats, ThreadsafeNodeFS } from '
|
|
1
|
+
import type { NodeFsStats, ThreadsafeNodeFS } from './binding';
|
|
2
2
|
import { type InputFileSystem, type IntermediateFileSystem, type OutputFileSystem } from './util/fs';
|
|
3
3
|
declare class ThreadsafeInputNodeFS implements ThreadsafeNodeFS {
|
|
4
4
|
writeFile: (name: string, content: Buffer) => Promise<void>;
|
|
@@ -51,4 +51,4 @@ declare class ThreadsafeIntermediateNodeFS extends ThreadsafeOutputNodeFS {
|
|
|
51
51
|
constructor(fs?: IntermediateFileSystem);
|
|
52
52
|
static __to_binding(fs?: IntermediateFileSystem): ThreadsafeIntermediateNodeFS;
|
|
53
53
|
}
|
|
54
|
-
export { ThreadsafeInputNodeFS,
|
|
54
|
+
export { ThreadsafeInputNodeFS, ThreadsafeIntermediateNodeFS, ThreadsafeOutputNodeFS, };
|
package/dist/Module.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import binding, { type AssetInfo } from '
|
|
1
|
+
import binding, { type AssetInfo } from './binding';
|
|
2
2
|
import type { Source } from 'webpack-sources';
|
|
3
3
|
import type { ResourceData } from './Resolver';
|
|
4
4
|
import './BuildInfo';
|
|
@@ -32,11 +32,11 @@ export declare class ContextModuleFactoryAfterResolveData {
|
|
|
32
32
|
private constructor();
|
|
33
33
|
}
|
|
34
34
|
export type ContextModuleFactoryAfterResolveResult = false | ContextModuleFactoryAfterResolveData;
|
|
35
|
-
declare module '
|
|
35
|
+
declare module './binding' {
|
|
36
36
|
interface Module {
|
|
37
37
|
identifier(): string;
|
|
38
38
|
originalSource(): Source | null;
|
|
39
39
|
emitFile(filename: string, source: Source, assetInfo?: AssetInfo): void;
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
export { Module } from '
|
|
42
|
+
export { Module } from './binding';
|
package/dist/ModuleGraph.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Dependency, JsModuleGraph, ModuleGraphConnection } from '
|
|
1
|
+
import type { Dependency, JsModuleGraph, ModuleGraphConnection } from './binding';
|
|
2
2
|
import { ExportsInfo } from './ExportsInfo';
|
|
3
3
|
import type { Module } from './Module';
|
|
4
4
|
export default class ModuleGraph {
|
|
@@ -7,6 +7,7 @@ export default class ModuleGraph {
|
|
|
7
7
|
constructor(binding: JsModuleGraph);
|
|
8
8
|
getModule(dependency: Dependency): Module | null;
|
|
9
9
|
getResolvedModule(dependency: Dependency): Module | null;
|
|
10
|
+
getUsedExports(module: Module, runtime: string | string[]): string[] | boolean | null;
|
|
10
11
|
getParentModule(dependency: Dependency): Module | null;
|
|
11
12
|
getIssuer(module: Module): Module | null;
|
|
12
13
|
getExportsInfo(module: Module): ExportsInfo;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import binding from '
|
|
1
|
+
import binding from './binding';
|
|
2
2
|
import type Watchpack from 'watchpack';
|
|
3
3
|
import type { FileSystemInfoEntry, InputFileSystem, Watcher, WatchFileSystem } from './util/fs';
|
|
4
4
|
export default class NativeWatchFileSystem implements WatchFileSystem {
|
package/dist/NormalModule.d.ts
CHANGED
|
@@ -4,12 +4,11 @@ import type { LoaderContext } from './config';
|
|
|
4
4
|
import type { Module } from './Module';
|
|
5
5
|
export interface NormalModuleCompilationHooks {
|
|
6
6
|
loader: liteTapable.SyncHook<[LoaderContext, Module]>;
|
|
7
|
-
readResourceForScheme: any;
|
|
8
7
|
readResource: liteTapable.HookMap<liteTapable.AsyncSeriesBailHook<[LoaderContext], string | Buffer>>;
|
|
9
8
|
}
|
|
10
|
-
declare module '
|
|
9
|
+
declare module './binding' {
|
|
11
10
|
interface NormalModuleConstructor {
|
|
12
11
|
getCompilationHooks(compilation: Compilation): NormalModuleCompilationHooks;
|
|
13
12
|
}
|
|
14
13
|
}
|
|
15
|
-
export { NormalModule } from '
|
|
14
|
+
export { NormalModule } from './binding';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type binding from '
|
|
1
|
+
import type binding from './binding';
|
|
2
2
|
import * as liteTapable from '@rspack/lite-tapable';
|
|
3
3
|
import type { ResolveData, ResourceDataWithData } from './Module';
|
|
4
4
|
import type { ResolveOptionsWithDependencyType, ResolverFactory } from './ResolverFactory';
|
package/dist/Resolver.d.ts
CHANGED
package/dist/RspackError.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type binding from '
|
|
2
|
-
export type { RspackError } from '
|
|
1
|
+
import type binding from './binding';
|
|
2
|
+
export type { RspackError } from './binding';
|
|
3
3
|
export type RspackSeverity = binding.JsRspackSeverity;
|
|
4
4
|
export declare class NonErrorEmittedError extends Error {
|
|
5
5
|
constructor(error: Error);
|
package/dist/RuntimeGlobals.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Copyright (c) JS Foundation and other contributors
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
|
-
import type { JsRuntimeGlobals } from '
|
|
10
|
+
import type { JsRuntimeGlobals } from './binding';
|
|
11
11
|
import type { RspackOptionsNormalized } from './config';
|
|
12
12
|
export declare function __from_binding_runtime_globals(runtimeRequirements: JsRuntimeGlobals, compilerRuntimeGlobals: Record<string, string>): Set<string>;
|
|
13
13
|
export declare function __to_binding_runtime_globals(runtimeRequirements: Set<string>, compilerRuntimeGlobals: Record<string, string>): JsRuntimeGlobals;
|
|
@@ -352,5 +352,5 @@ export declare enum RuntimeVariable {
|
|
|
352
352
|
}
|
|
353
353
|
export declare function renderRuntimeVariables(variable: RuntimeVariable, _compilerOptions?: RspackOptionsNormalized): string;
|
|
354
354
|
export declare function createCompilerRuntimeGlobals(compilerOptions?: RspackOptionsNormalized): Record<keyof typeof RuntimeGlobals, string>;
|
|
355
|
-
declare const DefaultRuntimeGlobals: Record<"
|
|
355
|
+
declare const DefaultRuntimeGlobals: Record<"module" | "publicPath" | "chunkName" | "moduleId" | "exports" | "require" | "global" | "system" | "requireScope" | "thisAsExports" | "returnExportsFromRuntime" | "moduleLoaded" | "entryModuleId" | "moduleCache" | "moduleFactories" | "moduleFactoriesAddOnly" | "ensureChunk" | "ensureChunkHandlers" | "ensureChunkIncludeEntries" | "prefetchChunk" | "prefetchChunkHandlers" | "preloadChunk" | "preloadChunkHandlers" | "definePropertyGetters" | "makeNamespaceObject" | "createFakeNamespaceObject" | "compatGetDefaultExport" | "harmonyModuleDecorator" | "nodeModuleDecorator" | "getFullHash" | "wasmInstances" | "instantiateWasm" | "uncaughtErrorHandler" | "scriptNonce" | "loadScript" | "createScript" | "createScriptUrl" | "getTrustedTypesPolicy" | "hasFetchPriority" | "runtimeId" | "getChunkScriptFilename" | "getChunkCssFilename" | "rspackVersion" | "hasCssModules" | "rspackUniqueId" | "getChunkUpdateScriptFilename" | "getChunkUpdateCssFilename" | "startup" | "startupNoDefault" | "startupOnlyAfter" | "startupOnlyBefore" | "chunkCallback" | "startupEntrypoint" | "startupChunkDependencies" | "onChunksLoaded" | "externalInstallChunk" | "interceptModuleExecution" | "shareScopeMap" | "initializeSharing" | "currentRemoteGetScope" | "getUpdateManifestFilename" | "hmrDownloadManifest" | "hmrDownloadUpdateHandlers" | "hmrModuleData" | "hmrInvalidateModuleHandlers" | "hmrRuntimeStatePrefix" | "amdDefine" | "amdOptions" | "hasOwnProperty" | "systemContext" | "baseURI" | "relativeUrl" | "asyncModule" | "asyncModuleExportSymbol" | "makeDeferredNamespaceObject" | "makeDeferredNamespaceObjectSymbol", string>;
|
|
356
356
|
export { DefaultRuntimeGlobals as RuntimeGlobals };
|
package/dist/RuntimeModule.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { JsAddingRuntimeModule, JsRuntimeModule, JsSource } from '
|
|
1
|
+
import type { JsAddingRuntimeModule, JsRuntimeModule, JsSource } from './binding';
|
|
2
2
|
import type { Chunk } from './Chunk';
|
|
3
3
|
import type { ChunkGraph } from './ChunkGraph';
|
|
4
4
|
import type { Compilation } from './Compilation';
|
|
@@ -31,7 +31,7 @@ export declare class BrowserRequirePlugin {
|
|
|
31
31
|
* This is an unsafe way to execute code in the browser using `new Function`.
|
|
32
32
|
* It is your responsibility to ensure that your application is not vulnerable to attacks due to this function.
|
|
33
33
|
*/
|
|
34
|
-
static unsafeExecute: (
|
|
34
|
+
static unsafeExecute: (code: string, runtime: CommonJsRuntime) => void;
|
|
35
35
|
constructor(options: BrowserRequirePluginOptions);
|
|
36
36
|
apply(compiler: Compiler): void;
|
|
37
37
|
}
|
package/dist/browser/fs.d.ts
CHANGED
|
@@ -10,4 +10,4 @@ declare const readFileSync: (file: import("memfs/lib/core").TFileId, options?: i
|
|
|
10
10
|
(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;
|
|
11
11
|
}, 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;
|
|
12
12
|
export default fs;
|
|
13
|
-
export {
|
|
13
|
+
export { existsSync, lstat, readdir, readdirSync, readFileSync, watch };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const lazyCompilationMiddleware: () => never;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { GetLoaderOptions } from '../../config/adapterRuleUse';
|
|
1
2
|
/**
|
|
2
3
|
MIT License
|
|
3
4
|
|
|
@@ -49,15 +50,15 @@ export declare enum Features {
|
|
|
49
50
|
Color = 64512
|
|
50
51
|
}
|
|
51
52
|
export interface Targets {
|
|
52
|
-
android?:
|
|
53
|
-
chrome?:
|
|
54
|
-
edge?:
|
|
55
|
-
firefox?:
|
|
56
|
-
ie?:
|
|
57
|
-
ios_saf?:
|
|
58
|
-
opera?:
|
|
59
|
-
safari?:
|
|
60
|
-
samsung?:
|
|
53
|
+
android?: string;
|
|
54
|
+
chrome?: string;
|
|
55
|
+
edge?: string;
|
|
56
|
+
firefox?: string;
|
|
57
|
+
ie?: string;
|
|
58
|
+
ios_saf?: string;
|
|
59
|
+
opera?: string;
|
|
60
|
+
safari?: string;
|
|
61
|
+
samsung?: string;
|
|
61
62
|
}
|
|
62
63
|
export interface Drafts {
|
|
63
64
|
/** Whether to enable @custom-media rules. */
|
|
@@ -110,3 +111,4 @@ export type LoaderOptions = {
|
|
|
110
111
|
pseudoClasses?: PseudoClasses;
|
|
111
112
|
unusedSymbols?: string[];
|
|
112
113
|
};
|
|
114
|
+
export declare const getLightningcssLoaderOptions: GetLoaderOptions;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type binding from '../../binding';
|
|
2
|
+
import type { Targets } from './index';
|
|
3
|
+
export declare function encodeTargets(targets: Targets): binding.RawLightningCssBrowsers;
|
|
4
|
+
export declare function defaultTargetsFromRspackTargets(targets: Record<string, string>): binding.RawLightningCssBrowsers;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { GetLoaderOptions } from '../../config/adapterRuleUse';
|
|
1
2
|
export type { CollectTypeScriptInfoOptions } from './collectTypeScriptInfo';
|
|
2
|
-
export { resolveCollectTypeScriptInfo } from './collectTypeScriptInfo';
|
|
3
3
|
export type { PluginImportOptions } from './pluginImport';
|
|
4
|
-
export { resolvePluginImport } from './pluginImport';
|
|
5
4
|
export type { SwcLoaderEnvConfig, SwcLoaderEsParserConfig, SwcLoaderJscConfig, SwcLoaderModuleConfig, SwcLoaderOptions, SwcLoaderParserConfig, SwcLoaderTransformConfig, SwcLoaderTsParserConfig, } from './types';
|
|
5
|
+
export declare const getSwcLoaderOptions: GetLoaderOptions;
|
|
@@ -29,5 +29,5 @@ type PluginImportConfig = {
|
|
|
29
29
|
};
|
|
30
30
|
type PluginImportOptions = PluginImportConfig[];
|
|
31
31
|
declare function resolvePluginImport(pluginImport: PluginImportOptions): RawPluginImportConfig[] | undefined;
|
|
32
|
-
export { resolvePluginImport };
|
|
33
32
|
export type { PluginImportOptions };
|
|
33
|
+
export { resolvePluginImport };
|
|
@@ -8,21 +8,55 @@ export type SwcLoaderParserConfig = ParserConfig;
|
|
|
8
8
|
export type SwcLoaderEsParserConfig = EsParserConfig;
|
|
9
9
|
export type SwcLoaderTsParserConfig = TsParserConfig;
|
|
10
10
|
export type SwcLoaderTransformConfig = TransformConfig;
|
|
11
|
-
|
|
11
|
+
type SwcLoaderCommonOptions = Omit<Config, 'jsc'> & {
|
|
12
12
|
isModule?: boolean | 'unknown';
|
|
13
13
|
/**
|
|
14
14
|
* Collects information from TypeScript's AST for consumption by subsequent Rspack processes,
|
|
15
15
|
* providing better TypeScript development experience and smaller output bundle size.
|
|
16
16
|
*/
|
|
17
17
|
collectTypeScriptInfo?: CollectTypeScriptInfoOptions;
|
|
18
|
+
/**
|
|
19
|
+
* Ported from [babel-plugin-import](https://github.com/umijs/babel-plugin-import),
|
|
20
|
+
* used to transform imports for modular component libraries.
|
|
21
|
+
*/
|
|
22
|
+
transformImport?: PluginImportOptions;
|
|
18
23
|
/**
|
|
19
24
|
* Experimental features provided by Rspack.
|
|
20
25
|
* @experimental
|
|
21
26
|
*/
|
|
22
27
|
rspackExperiments?: {
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated Use top-level `transformImport` instead.
|
|
30
|
+
*/
|
|
23
31
|
import?: PluginImportOptions;
|
|
32
|
+
/**
|
|
33
|
+
* Enable React Server Components support.
|
|
34
|
+
*/
|
|
35
|
+
reactServerComponents?: boolean | ReactServerComponentsOptions;
|
|
24
36
|
};
|
|
25
37
|
};
|
|
38
|
+
export type SwcLoaderOptions = (SwcLoaderCommonOptions & {
|
|
39
|
+
/**
|
|
40
|
+
* When set to `"auto"`, `builtin:swc-loader` infers `jsc.parser` from the resource extension.
|
|
41
|
+
* This is useful when one rule needs to handle mixed module types such as `.js`, `.jsx`, `.ts`, and `.tsx`.
|
|
42
|
+
* @default false
|
|
43
|
+
*/
|
|
44
|
+
detectSyntax?: false;
|
|
45
|
+
jsc?: JscConfig;
|
|
46
|
+
}) | (SwcLoaderCommonOptions & {
|
|
47
|
+
detectSyntax: 'auto';
|
|
48
|
+
jsc?: Omit<JscConfig, 'parser'> & {
|
|
49
|
+
parser?: Partial<ParserConfig>;
|
|
50
|
+
};
|
|
51
|
+
});
|
|
52
|
+
export interface ReactServerComponentsOptions {
|
|
53
|
+
/**
|
|
54
|
+
* Whether to disable the compile-time check that reports errors when React
|
|
55
|
+
* client-only APIs (e.g. `useState`, `useEffect`) are imported in server
|
|
56
|
+
* components. Defaults to `false`.
|
|
57
|
+
*/
|
|
58
|
+
disableClientApiChecks?: boolean;
|
|
59
|
+
}
|
|
26
60
|
export interface TerserCompressOptions {
|
|
27
61
|
arguments?: boolean;
|
|
28
62
|
arrows?: boolean;
|
|
@@ -81,3 +115,4 @@ export interface TerserCompressOptions {
|
|
|
81
115
|
const_to_let?: boolean;
|
|
82
116
|
module?: boolean;
|
|
83
117
|
}
|
|
118
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type BuiltinPlugin, BuiltinPluginName } from '
|
|
1
|
+
import { type BuiltinPlugin, BuiltinPluginName } from '../binding';
|
|
2
2
|
import type { Compilation } from '../Compilation';
|
|
3
3
|
import type { Compiler } from '../Compiler';
|
|
4
4
|
import type { Module } from '../Module';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type RawCopyPattern } from '
|
|
1
|
+
import { type RawCopyPattern } from '../binding';
|
|
2
2
|
export type CopyRspackPluginOptions = {
|
|
3
3
|
/** An array of objects that describe the copy operations to be performed. */
|
|
4
4
|
patterns: (string | (Pick<RawCopyPattern, 'from'> & Partial<Omit<RawCopyPattern, 'from'>>))[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type BuiltinPlugin, BuiltinPluginName } from '
|
|
1
|
+
import { type BuiltinPlugin, BuiltinPluginName } from '../binding';
|
|
2
2
|
import { RspackBuiltinPlugin } from './base';
|
|
3
3
|
export declare class DeterministicChunkIdsPlugin extends RspackBuiltinPlugin {
|
|
4
4
|
name: BuiltinPluginName;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type BuiltinPlugin, BuiltinPluginName } from '
|
|
1
|
+
import { type BuiltinPlugin, BuiltinPluginName } from '../binding';
|
|
2
2
|
import { RspackBuiltinPlugin } from './base';
|
|
3
3
|
export declare class DeterministicModuleIdsPlugin extends RspackBuiltinPlugin {
|
|
4
4
|
name: BuiltinPluginName;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type RawDllReferenceAgencyPluginOptions } from '
|
|
1
|
+
import { type RawDllReferenceAgencyPluginOptions } from '../binding';
|
|
2
2
|
export type DllReferenceAgencyPluginOptions = RawDllReferenceAgencyPluginOptions;
|
|
3
3
|
export declare const DllReferenceAgencyPlugin: {
|
|
4
4
|
new (options: RawDllReferenceAgencyPluginOptions): {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type BuiltinPlugin, BuiltinPluginName } from '
|
|
1
|
+
import { type BuiltinPlugin, BuiltinPluginName } from '../binding';
|
|
2
2
|
import type { Compiler } from '../Compiler';
|
|
3
3
|
import type { EntryDynamicNormalized } from '../config';
|
|
4
4
|
import { RspackBuiltinPlugin } from './base';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type BuiltinPlugin, BuiltinPluginName } from '
|
|
1
|
+
import { type BuiltinPlugin, BuiltinPluginName } from '../binding';
|
|
2
2
|
import type { Compiler, LibraryType } from '..';
|
|
3
3
|
import { RspackBuiltinPlugin } from './base';
|
|
4
4
|
export declare class EnableLibraryPlugin extends RspackBuiltinPlugin {
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import type { Compiler } from '../Compiler';
|
|
2
|
+
import type { OptimizationSplitChunksOptions, RspackOptionsNormalized } from '../config';
|
|
3
|
+
export declare function applyLimits(options: RspackOptionsNormalized): void;
|
|
2
4
|
export declare class EsmLibraryPlugin {
|
|
3
5
|
static PLUGIN_NAME: string;
|
|
4
|
-
options
|
|
6
|
+
options: {
|
|
5
7
|
preserveModules?: string;
|
|
8
|
+
splitChunks?: OptimizationSplitChunksOptions | false;
|
|
6
9
|
};
|
|
7
10
|
constructor(options?: {
|
|
8
11
|
preserveModules?: string;
|
|
12
|
+
splitChunks?: OptimizationSplitChunksOptions | false;
|
|
9
13
|
});
|
|
10
14
|
apply(compiler: Compiler): void;
|
|
11
15
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const EsmNodeTargetPlugin: {
|
|
2
|
+
new (): {
|
|
3
|
+
name: string;
|
|
4
|
+
_args: [];
|
|
5
|
+
affectedHooks: keyof import("..").CompilerHooks | undefined;
|
|
6
|
+
raw(compiler: import("..").Compiler): import("../binding").BuiltinPlugin;
|
|
7
|
+
apply(compiler: import("..").Compiler): void;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type RawEvalDevToolModulePluginOptions } from '
|
|
1
|
+
import { type RawEvalDevToolModulePluginOptions } from '../binding';
|
|
2
2
|
export type { RawEvalDevToolModulePluginOptions as EvalDevToolModulePluginOptions };
|
|
3
3
|
export declare const EvalDevToolModulePlugin: {
|
|
4
4
|
new (options: RawEvalDevToolModulePluginOptions): {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type BuiltinPlugin, BuiltinPluginName } from '
|
|
1
|
+
import { type BuiltinPlugin, BuiltinPluginName } from '../binding';
|
|
2
2
|
import type { Externals } from '..';
|
|
3
3
|
import { RspackBuiltinPlugin } from './base';
|
|
4
4
|
export declare class ExternalsPlugin extends RspackBuiltinPlugin {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type BuiltinPlugin, BuiltinPluginName } from '
|
|
1
|
+
import { type BuiltinPlugin, BuiltinPluginName } from '../binding';
|
|
2
2
|
import { RspackBuiltinPlugin } from './base';
|
|
3
3
|
export declare class FlagDependencyUsagePlugin extends RspackBuiltinPlugin {
|
|
4
4
|
private global;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type BuiltinPlugin, BuiltinPluginName } from '
|
|
1
|
+
import { type BuiltinPlugin, BuiltinPluginName } from '../binding';
|
|
2
2
|
import type { Compiler } from '../Compiler';
|
|
3
3
|
import { RspackBuiltinPlugin } from './base';
|
|
4
4
|
export declare class HotModuleReplacementPlugin extends RspackBuiltinPlugin {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type BuiltinPlugin, BuiltinPluginName, type RawHttpUriPluginOptions } from '
|
|
1
|
+
import { type BuiltinPlugin, BuiltinPluginName, type RawHttpUriPluginOptions } from '../binding';
|
|
2
2
|
import type { Compiler } from '../Compiler';
|
|
3
3
|
import { RspackBuiltinPlugin } from './base';
|
|
4
4
|
export type HttpUriPluginOptionsAllowedUris = (string | RegExp)[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type RawIgnorePluginOptions } from '
|
|
1
|
+
import { type RawIgnorePluginOptions } from '../binding';
|
|
2
2
|
export type IgnorePluginOptions = {
|
|
3
3
|
/** A RegExp to test the resource against. */
|
|
4
4
|
resourceRegExp: NonNullable<RawIgnorePluginOptions['resourceRegExp']>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type BuiltinPlugin, BuiltinPluginName } from '
|
|
1
|
+
import { type BuiltinPlugin, BuiltinPluginName } from '../binding';
|
|
2
2
|
import * as liteTapable from '@rspack/lite-tapable';
|
|
3
3
|
import type { Chunk } from '../Chunk';
|
|
4
4
|
import { type Compilation } from '../Compilation';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { type Drafts, type FeatureOptions, type NonStandard, type PseudoClasses } from '../builtin-loader/lightningcss';
|
|
1
|
+
import { type Drafts, type FeatureOptions, type NonStandard, type PseudoClasses, type Targets } from '../builtin-loader/lightningcss';
|
|
2
|
+
import type { Compiler } from '../Compiler';
|
|
2
3
|
import type { AssetConditions } from '../util/assetCondition';
|
|
3
4
|
export type LightningCssMinimizerRspackPluginOptions = {
|
|
4
5
|
test?: AssetConditions;
|
|
@@ -7,7 +8,7 @@ export type LightningCssMinimizerRspackPluginOptions = {
|
|
|
7
8
|
removeUnusedLocalIdents?: boolean;
|
|
8
9
|
minimizerOptions?: {
|
|
9
10
|
errorRecovery?: boolean;
|
|
10
|
-
targets?: string[] | string;
|
|
11
|
+
targets?: string[] | string | Targets;
|
|
11
12
|
include?: FeatureOptions;
|
|
12
13
|
exclude?: FeatureOptions;
|
|
13
14
|
drafts?: Drafts;
|
|
@@ -21,7 +22,7 @@ export declare const LightningCssMinimizerRspackPlugin: {
|
|
|
21
22
|
name: string;
|
|
22
23
|
_args: [options?: LightningCssMinimizerRspackPluginOptions | undefined];
|
|
23
24
|
affectedHooks: keyof import("..").CompilerHooks | undefined;
|
|
24
|
-
raw(compiler:
|
|
25
|
-
apply(compiler:
|
|
25
|
+
raw(compiler: Compiler): import("../binding").BuiltinPlugin;
|
|
26
|
+
apply(compiler: Compiler): void;
|
|
26
27
|
};
|
|
27
28
|
};
|