@rspack-canary/browser 1.7.0-canary-9a468043-20251230094321 → 1.7.0-canary-e04df144-20251230191636
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 +4 -4
- package/dist/Chunk.d.ts +3 -3
- package/dist/ChunkGraph.d.ts +3 -3
- package/dist/Chunks.d.ts +2 -2
- package/dist/Compilation.d.ts +40 -40
- package/dist/Compiler.d.ts +25 -23
- package/dist/ConcatenatedModule.d.ts +1 -1
- package/dist/ContextModule.d.ts +1 -1
- package/dist/ContextModuleFactory.d.ts +2 -2
- package/dist/Diagnostics.d.ts +2 -2
- package/dist/Entrypoint.d.ts +1 -1
- package/dist/ExecuteModulePlugin.d.ts +1 -1
- package/dist/ExportsInfo.d.ts +2 -2
- package/dist/ExternalModule.d.ts +1 -1
- package/dist/FileSystem.d.ts +3 -3
- package/dist/Module.d.ts +6 -6
- package/dist/ModuleGraph.d.ts +3 -3
- package/dist/MultiCompiler.d.ts +8 -8
- package/dist/MultiStats.d.ts +3 -3
- package/dist/MultiWatching.d.ts +3 -3
- package/dist/NativeWatchFileSystem.d.ts +5 -5
- package/dist/NormalModule.d.ts +6 -6
- package/dist/NormalModuleFactory.d.ts +4 -4
- package/dist/Resolver.d.ts +2 -2
- package/dist/ResolverFactory.d.ts +3 -3
- package/dist/RspackError.d.ts +2 -2
- package/dist/RuntimeGlobals.d.ts +2 -2
- package/dist/RuntimeModule.d.ts +4 -4
- package/dist/Stats.d.ts +4 -4
- package/dist/VirtualModulesPlugin.d.ts +1 -1
- package/dist/Watching.d.ts +5 -5
- package/dist/browser/BrowserHttpImportEsmPlugin.d.ts +1 -1
- package/dist/browser/BrowserRequirePlugin.d.ts +1 -1
- package/dist/browser/buffer.d.ts +1 -1
- package/dist/browser/fs.d.ts +1 -1
- package/dist/browser/index.d.ts +3 -3
- package/dist/builtin-loader/index.d.ts +1 -1
- package/dist/builtin-loader/swc/collectTypeScriptInfo.d.ts +1 -1
- package/dist/builtin-loader/swc/index.d.ts +5 -5
- package/dist/builtin-loader/swc/types.d.ts +10 -8
- package/dist/builtin-plugin/BannerPlugin.d.ts +1 -1
- package/dist/builtin-plugin/{WarnCaseSensitiveModulesPlugin.d.ts → CaseSensitivePlugin.d.ts} +1 -1
- package/dist/builtin-plugin/CircularDependencyRspackPlugin.d.ts +5 -10
- package/dist/builtin-plugin/CopyRspackPlugin.d.ts +2 -2
- package/dist/builtin-plugin/CssChunkingPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DeterministicChunkIdsPlugin.d.ts +2 -2
- package/dist/builtin-plugin/DeterministicModuleIdsPlugin.d.ts +2 -2
- package/dist/builtin-plugin/DllReferenceAgencyPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DynamicEntryPlugin.d.ts +4 -4
- package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EnableLibraryPlugin.d.ts +3 -3
- package/dist/builtin-plugin/EntryPlugin.d.ts +3 -3
- package/dist/builtin-plugin/EsmLibraryPlugin.d.ts +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/FlagDependencyUsagePlugin.d.ts +2 -2
- package/dist/builtin-plugin/HotModuleReplacementPlugin.d.ts +3 -3
- package/dist/builtin-plugin/HttpUriPlugin.d.ts +4 -4
- package/dist/builtin-plugin/IgnorePlugin.d.ts +4 -4
- package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +6 -6
- package/dist/builtin-plugin/JsLoaderRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/LightningCssMinimizerRspackPlugin.d.ts +2 -2
- package/dist/builtin-plugin/MangleExportsPlugin.d.ts +2 -2
- package/dist/builtin-plugin/ModuleConcatenationPlugin.d.ts +2 -2
- package/dist/builtin-plugin/NaturalChunkIdsPlugin.d.ts +2 -2
- package/dist/builtin-plugin/NaturalModuleIdsPlugin.d.ts +2 -2
- package/dist/builtin-plugin/NormalModuleReplacementPlugin.d.ts +1 -1
- package/dist/builtin-plugin/OccurrenceChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ProgressPlugin.d.ts +2 -2
- package/dist/builtin-plugin/RsdoctorPlugin.d.ts +8 -8
- package/dist/builtin-plugin/RslibPlugin.d.ts +2 -2
- package/dist/builtin-plugin/RstestPlugin.d.ts +2 -2
- package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RuntimePlugin.d.ts +5 -5
- package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SplitChunksPlugin.d.ts +4 -4
- package/dist/builtin-plugin/SubresourceIntegrityPlugin.d.ts +5 -5
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +3 -3
- package/dist/builtin-plugin/WebWorkerTemplatePlugin.d.ts +3 -3
- package/dist/builtin-plugin/WorkerPlugin.d.ts +4 -4
- package/dist/builtin-plugin/base.d.ts +3 -3
- package/dist/builtin-plugin/css-extract/index.d.ts +7 -7
- package/dist/builtin-plugin/css-extract/loader.d.ts +2 -2
- package/dist/builtin-plugin/css-extract/utils.d.ts +1 -1
- package/dist/builtin-plugin/html-plugin/hooks.d.ts +4 -4
- package/dist/builtin-plugin/html-plugin/index.d.ts +2 -2
- package/dist/builtin-plugin/html-plugin/options.d.ts +6 -6
- package/dist/builtin-plugin/html-plugin/plugin.d.ts +5 -5
- package/dist/builtin-plugin/html-plugin/taps.d.ts +1 -1
- package/dist/builtin-plugin/index.d.ts +84 -88
- package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +1 -1
- package/dist/builtin-plugin/lazy-compilation/middleware.d.ts +2 -2
- package/dist/config/adapter.d.ts +7 -7
- package/dist/config/adapterRuleUse.d.ts +16 -16
- package/dist/config/browserslistTargetHandler.d.ts +1 -1
- package/dist/config/defaults.d.ts +11 -2
- package/dist/config/devServer.d.ts +32 -32
- package/dist/config/index.d.ts +5 -5
- package/dist/config/normalization.d.ts +9 -9
- package/dist/config/target.d.ts +7 -7
- package/dist/config/types.d.ts +75 -74
- package/dist/container/ContainerPlugin.d.ts +4 -4
- package/dist/container/ContainerReferencePlugin.d.ts +4 -4
- package/dist/container/ModuleFederationManifestPlugin.d.ts +3 -3
- package/dist/container/ModuleFederationPlugin.d.ts +6 -6
- package/dist/container/ModuleFederationPluginV1.d.ts +5 -5
- package/dist/container/index.d.ts +4 -4
- package/dist/exports.d.ts +76 -74
- package/dist/index.d.ts +3 -3
- package/dist/index.mjs +2344 -2615
- package/dist/lib/AbstractMethodError.d.ts +1 -1
- package/dist/lib/Cache.d.ts +2 -2
- package/dist/lib/CacheFacade.d.ts +3 -3
- package/dist/lib/DllPlugin.d.ts +1 -1
- package/dist/lib/DllReferencePlugin.d.ts +5 -5
- package/dist/lib/EntryOptionPlugin.d.ts +2 -2
- package/dist/lib/EnvironmentPlugin.d.ts +1 -1
- package/dist/lib/HookWebpackError.d.ts +2 -2
- package/dist/lib/IgnoreWarningsPlugin.d.ts +1 -1
- package/dist/lib/LoaderOptionsPlugin.d.ts +2 -2
- package/dist/lib/LoaderTargetPlugin.d.ts +2 -2
- package/dist/lib/WebpackError.d.ts +3 -3
- package/dist/lib/cache/MemoryCachePlugin.d.ts +1 -1
- package/dist/lib/cache/getLazyHashedEtag.d.ts +1 -1
- package/dist/lib/cache/mergeEtags.d.ts +1 -1
- package/dist/loader-runner/ModuleError.d.ts +1 -1
- package/dist/loader-runner/index.d.ts +3 -3
- package/dist/loader-runner/loadLoader.d.ts +2 -2
- package/dist/loader-runner/service.d.ts +8 -8
- package/dist/loader-runner/utils.d.ts +3 -3
- package/dist/loader-runner/worker.d.ts +3 -3
- package/dist/logging/createConsoleLogger.d.ts +4 -4
- package/dist/napi-binding.d.ts +12 -13
- package/dist/node/NodeEnvironmentPlugin.d.ts +2 -2
- package/dist/node/NodeTemplatePlugin.d.ts +1 -1
- package/dist/node/NodeWatchFileSystem.d.ts +3 -3
- package/dist/node/nodeConsole.d.ts +2 -2
- package/dist/rslib-runtime.js +29 -0
- package/dist/rslib-runtime.mjs +68 -0
- package/dist/rspack.d.ts +15 -6
- package/dist/rspack.wasi-browser.js +0 -1
- package/dist/rspack.wasm32-wasi.wasm +0 -0
- package/dist/rspackOptionsApply.d.ts +1 -1
- package/dist/sharing/ConsumeSharedPlugin.d.ts +3 -3
- package/dist/sharing/ProvideSharedPlugin.d.ts +4 -4
- package/dist/sharing/SharePlugin.d.ts +1 -1
- package/dist/sharing/ShareRuntimePlugin.d.ts +3 -3
- package/dist/stats/DefaultStatsFactoryPlugin.d.ts +15 -15
- package/dist/stats/DefaultStatsPresetPlugin.d.ts +1 -1
- package/dist/stats/DefaultStatsPrinterPlugin.d.ts +1 -1
- package/dist/stats/StatsFactory.d.ts +5 -5
- package/dist/stats/StatsPrinter.d.ts +3 -3
- package/dist/stats/statsFactoryUtils.d.ts +5 -5
- package/dist/swc.d.ts +2 -2
- package/dist/taps/compilation.d.ts +2 -2
- package/dist/taps/compiler.d.ts +1 -1
- package/dist/taps/contextModuleFactory.d.ts +1 -1
- package/dist/taps/index.d.ts +6 -6
- package/dist/taps/javascriptModules.d.ts +1 -1
- package/dist/taps/normalModuleFactory.d.ts +1 -1
- package/dist/taps/types.d.ts +3 -3
- package/dist/trace/index.d.ts +4 -4
- package/dist/trace/traceHookPlugin.d.ts +1 -1
- package/dist/util/SplitChunkSize.d.ts +1 -1
- package/dist/util/createHash.d.ts +1 -1
- package/dist/util/createReadonlyMap.d.ts +1 -1
- package/dist/util/fs.d.ts +14 -14
- package/dist/util/hash/wasm-hash.d.ts +1 -1
- package/dist/util/identifier.d.ts +1 -1
- package/dist/util/index.d.ts +2 -1
- package/dist/util/source.d.ts +2 -2
- package/dist/util/validateConfig.d.ts +1 -1
- package/dist/wasi-worker-browser.mjs +22673 -22676
- package/package.json +1 -1
- package/dist/builtin-plugin/rsc/Coordinator.d.ts +0 -8
- package/dist/builtin-plugin/rsc/RscClientPlugin.d.ts +0 -10
- package/dist/builtin-plugin/rsc/RscServerPlugin.d.ts +0 -10
- package/dist/builtin-plugin/rsc/index.d.ts +0 -19
package/dist/lib/Cache.d.ts
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* Copyright (c) JS Foundation and other contributors
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
|
-
import { AsyncParallelHook, AsyncSeriesBailHook, SyncHook } from
|
|
11
|
-
import type { WebpackError } from
|
|
10
|
+
import { AsyncParallelHook, AsyncSeriesBailHook, SyncHook } from '@rspack/lite-tapable';
|
|
11
|
+
import type { WebpackError } from './WebpackError';
|
|
12
12
|
export interface Etag {
|
|
13
13
|
toString(): string;
|
|
14
14
|
}
|
|
@@ -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 { Cache, CallbackCache, Etag } from
|
|
11
|
-
import type { HashableObject, HashConstructor } from
|
|
12
|
-
import type WebpackError from
|
|
10
|
+
import type { Cache, CallbackCache, Etag } from './Cache';
|
|
11
|
+
import type { HashableObject, HashConstructor } from './cache/getLazyHashedEtag';
|
|
12
|
+
import type WebpackError from './WebpackError';
|
|
13
13
|
type CallbackNormalErrorCache<T> = (err?: WebpackError | null, result?: T) => void;
|
|
14
14
|
declare abstract class BaseCache {
|
|
15
15
|
abstract get<T>(callback: CallbackCache<T>): void;
|
package/dist/lib/DllPlugin.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 { Compiler } from
|
|
10
|
+
import type { Compiler } from '../Compiler';
|
|
11
11
|
export type DllPluginOptions = {
|
|
12
12
|
/**
|
|
13
13
|
* Context of requests in the manifest file (defaults to the webpack context).
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* Copyright (c) JS Foundation and other contributors
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
|
-
import type { JsBuildMeta } from
|
|
11
|
-
import type { Compiler } from
|
|
10
|
+
import type { JsBuildMeta } from '@rspack/binding';
|
|
11
|
+
import type { Compiler } from '../Compiler';
|
|
12
12
|
export type DllReferencePluginOptions = {
|
|
13
13
|
/**
|
|
14
14
|
* Context of requests in the manifest (or content property) as absolute path.
|
|
@@ -37,7 +37,7 @@ export type DllReferencePluginOptions = {
|
|
|
37
37
|
/**
|
|
38
38
|
* The way how the export of the dll bundle is used.
|
|
39
39
|
*/
|
|
40
|
-
type?:
|
|
40
|
+
type?: 'require' | 'object';
|
|
41
41
|
} | {
|
|
42
42
|
/**
|
|
43
43
|
* The mappings from request to module info.
|
|
@@ -66,12 +66,12 @@ export type DllReferencePluginOptions = {
|
|
|
66
66
|
/**
|
|
67
67
|
* The way how the export of the dll bundle is used.
|
|
68
68
|
*/
|
|
69
|
-
type?:
|
|
69
|
+
type?: 'require' | 'object';
|
|
70
70
|
};
|
|
71
71
|
/**
|
|
72
72
|
* The type how the dll is exposed (external type).
|
|
73
73
|
*/
|
|
74
|
-
export type DllReferencePluginOptionsSourceType =
|
|
74
|
+
export type DllReferencePluginOptionsSourceType = 'var' | 'assign' | 'this' | 'window' | 'global' | 'commonjs' | 'commonjs2' | 'commonjs-module' | 'amd' | 'amd-require' | 'umd' | 'umd2' | 'jsonp' | 'system';
|
|
75
75
|
/**
|
|
76
76
|
* An object containing content, name and type.
|
|
77
77
|
*/
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* Copyright (c) JS Foundation and other contributors
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
|
-
import type { Compiler, EntryDescriptionNormalized, EntryNormalized } from
|
|
11
|
-
import type { EntryOptions } from
|
|
10
|
+
import type { Compiler, EntryDescriptionNormalized, EntryNormalized } from '..';
|
|
11
|
+
import type { EntryOptions } from '../builtin-plugin';
|
|
12
12
|
export declare class EntryOptionPlugin {
|
|
13
13
|
/**
|
|
14
14
|
* @param compiler the compiler instance one is tapping into
|
|
@@ -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 { Compiler } from
|
|
10
|
+
import type { Compiler } from '../Compiler';
|
|
11
11
|
declare class EnvironmentPlugin {
|
|
12
12
|
keys: string[];
|
|
13
13
|
defaultValues: Record<string, string | undefined | null>;
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* Copyright (c) JS Foundation and other contributors
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
|
-
import type { Callback } from
|
|
11
|
-
import WebpackError from
|
|
10
|
+
import type { Callback } from '@rspack/lite-tapable';
|
|
11
|
+
import WebpackError from './WebpackError';
|
|
12
12
|
export declare class HookWebpackError extends WebpackError {
|
|
13
13
|
hook: string;
|
|
14
14
|
error: Error;
|
|
@@ -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 { Compiler, IgnoreWarningsNormalized, RspackPluginInstance } from
|
|
10
|
+
import type { Compiler, IgnoreWarningsNormalized, RspackPluginInstance } from '..';
|
|
11
11
|
declare class IgnoreWarningsPlugin implements RspackPluginInstance {
|
|
12
12
|
_ignorePattern: IgnoreWarningsNormalized;
|
|
13
13
|
name: string;
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* Copyright (c) JS Foundation and other contributors
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
|
-
import type { Compiler } from
|
|
11
|
-
import type { MatchObject } from
|
|
10
|
+
import type { Compiler } from '../Compiler';
|
|
11
|
+
import type { MatchObject } from './ModuleFilenameHelpers';
|
|
12
12
|
type LoaderOptionsPluginOptions = MatchObject & {
|
|
13
13
|
[key: string]: unknown;
|
|
14
14
|
};
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* Copyright (c) JS Foundation and other contributors
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
|
-
import type { Compiler } from
|
|
11
|
-
import type { Target } from
|
|
10
|
+
import type { Compiler } from '../Compiler';
|
|
11
|
+
import type { Target } from '../config';
|
|
12
12
|
export declare class LoaderTargetPlugin {
|
|
13
13
|
readonly target: Target;
|
|
14
14
|
/**
|
|
@@ -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 { DependencyLocation } from
|
|
11
|
-
import type { Chunk } from
|
|
12
|
-
import type { Module } from
|
|
10
|
+
import type { DependencyLocation } from '@rspack/binding';
|
|
11
|
+
import type { Chunk } from '../Chunk';
|
|
12
|
+
import type { Module } from '../Module';
|
|
13
13
|
export declare class WebpackError extends Error {
|
|
14
14
|
loc?: DependencyLocation;
|
|
15
15
|
file?: string;
|
|
@@ -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 Hash from
|
|
10
|
+
import type Hash from '../../util/hash';
|
|
11
11
|
export type HashConstructor = typeof Hash;
|
|
12
12
|
export interface HashableObject {
|
|
13
13
|
updateHash(hash: Hash): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type JsLoaderContext, type JsLoaderItem } from
|
|
2
|
-
import type { Compiler } from
|
|
1
|
+
import { type JsLoaderContext, type JsLoaderItem } from '@rspack/binding';
|
|
2
|
+
import type { Compiler } from '../Compiler';
|
|
3
3
|
export declare class LoaderObject {
|
|
4
4
|
request: string;
|
|
5
5
|
path: string;
|
|
@@ -10,7 +10,7 @@ export declare class LoaderObject {
|
|
|
10
10
|
normal?: Function;
|
|
11
11
|
pitch?: Function;
|
|
12
12
|
raw?: boolean;
|
|
13
|
-
type?:
|
|
13
|
+
type?: 'module' | 'commonjs';
|
|
14
14
|
parallel?: boolean | {
|
|
15
15
|
maxWorkers?: number;
|
|
16
16
|
};
|
|
@@ -7,6 +7,6 @@
|
|
|
7
7
|
* Copyright (c) JS Foundation and other contributors
|
|
8
8
|
* https://github.com/webpack/loader-runner/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
|
-
import type { Compiler } from
|
|
11
|
-
import type { LoaderObject } from
|
|
10
|
+
import type { Compiler } from '../exports';
|
|
11
|
+
import type { LoaderObject } from '.';
|
|
12
12
|
export default function loadLoader(loader: LoaderObject, compiler: Compiler, callback: (err: unknown) => void): void;
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import type { Tinypool } from
|
|
2
|
-
type RunOptions = Parameters<Tinypool[
|
|
1
|
+
import type { Tinypool } from 'tinypool' with { 'resolution-mode': 'import' };
|
|
2
|
+
type RunOptions = Parameters<Tinypool['run']>[1];
|
|
3
3
|
export interface WorkerResponseMessage {
|
|
4
|
-
type:
|
|
4
|
+
type: 'response';
|
|
5
5
|
id: number;
|
|
6
6
|
data: any;
|
|
7
7
|
}
|
|
8
8
|
export interface WorkerResponseErrorMessage {
|
|
9
|
-
type:
|
|
9
|
+
type: 'response-error';
|
|
10
10
|
id: number;
|
|
11
11
|
error: WorkerError;
|
|
12
12
|
}
|
|
13
13
|
interface WorkerDoneMessage {
|
|
14
|
-
type:
|
|
14
|
+
type: 'done';
|
|
15
15
|
data: WorkerArgs;
|
|
16
16
|
}
|
|
17
17
|
interface WorkerDoneErrorMessage {
|
|
18
|
-
type:
|
|
18
|
+
type: 'done-error';
|
|
19
19
|
error: WorkerError;
|
|
20
20
|
}
|
|
21
21
|
export interface WorkerRequestMessage {
|
|
22
|
-
type:
|
|
22
|
+
type: 'request';
|
|
23
23
|
id: number;
|
|
24
24
|
requestType: RequestType;
|
|
25
25
|
data: WorkerArgs;
|
|
26
26
|
}
|
|
27
27
|
export interface WorkerRequestSyncMessage {
|
|
28
|
-
type:
|
|
28
|
+
type: 'request-sync';
|
|
29
29
|
id: number;
|
|
30
30
|
requestType: RequestSyncType;
|
|
31
31
|
data: WorkerArgs;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { LoaderContext } from
|
|
2
|
-
import type { Compiler } from
|
|
3
|
-
import type { LoaderObject } from
|
|
1
|
+
import type { LoaderContext } from '../config/adapterRuleUse';
|
|
2
|
+
import type { Compiler } from '../exports';
|
|
3
|
+
import type { LoaderObject } from '.';
|
|
4
4
|
export declare function convertArgs(args: any[], raw: boolean): void;
|
|
5
5
|
export declare const loadLoader: (loaderObject: LoaderObject, compiler: Compiler) => Promise<void>;
|
|
6
6
|
export declare const runSyncOrAsync: (arg1: Function, arg2: LoaderContext<{}>, arg3: any[]) => Promise<any[]>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type MessagePort } from
|
|
2
|
-
import { JsLoaderState } from
|
|
3
|
-
import type { LoaderContext } from
|
|
1
|
+
import { type MessagePort } from 'node:worker_threads';
|
|
2
|
+
import { JsLoaderState } from '@rspack/binding';
|
|
3
|
+
import type { LoaderContext } from '../config';
|
|
4
4
|
interface WorkerOptions {
|
|
5
5
|
loaderContext: LoaderContext;
|
|
6
6
|
loaderState: JsLoaderState;
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* Copyright (c) JS Foundation and other contributors
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
|
-
import type { FilterTypes } from
|
|
11
|
-
import { type LogTypeEnum } from
|
|
10
|
+
import type { FilterTypes } from '../config';
|
|
11
|
+
import { type LogTypeEnum } from './Logger';
|
|
12
12
|
export type FilterFunction = (ident: string) => boolean;
|
|
13
13
|
export type LoggerConsole = {
|
|
14
14
|
clear: () => void;
|
|
@@ -27,9 +27,9 @@ export type LoggerConsole = {
|
|
|
27
27
|
logTime?: (...args: any[]) => void;
|
|
28
28
|
};
|
|
29
29
|
export type LoggerOptions = {
|
|
30
|
-
level:
|
|
30
|
+
level: 'none' | 'error' | 'warn' | 'info' | 'log' | 'verbose' | boolean;
|
|
31
31
|
debug: FilterTypes | boolean;
|
|
32
32
|
console: LoggerConsole;
|
|
33
33
|
};
|
|
34
|
-
declare const createConsoleLogger: ({ level, debug, console }: LoggerOptions) => (name: string, type: LogTypeEnum, args: any[]) => void;
|
|
34
|
+
declare const createConsoleLogger: ({ level, debug, console, }: LoggerOptions) => (name: string, type: LogTypeEnum, args: any[]) => void;
|
|
35
35
|
export { createConsoleLogger };
|
package/dist/napi-binding.d.ts
CHANGED
|
@@ -95,8 +95,6 @@ export interface JsSource {
|
|
|
95
95
|
source: string | Buffer
|
|
96
96
|
map?: string
|
|
97
97
|
}
|
|
98
|
-
|
|
99
|
-
export type CompilerId = void;
|
|
100
98
|
/* -- banner.d.ts end -- */
|
|
101
99
|
|
|
102
100
|
/* -- napi-rs generated below -- */
|
|
@@ -328,7 +326,7 @@ export declare class JsCompilation {
|
|
|
328
326
|
}
|
|
329
327
|
|
|
330
328
|
export declare class JsCompiler {
|
|
331
|
-
constructor(compilerPath: string, options: RawOptions, builtinPlugins: Array<BuiltinPlugin>, registerJsTaps: RegisterJsTaps, outputFilesystem: ThreadsafeNodeFS, intermediateFilesystem: ThreadsafeNodeFS | undefined | null, inputFilesystem: ThreadsafeNodeFS | undefined | null, resolverFactoryReference: JsResolverFactory, unsafeFastDrop: boolean)
|
|
329
|
+
constructor(compilerPath: string, options: RawOptions, builtinPlugins: Array<BuiltinPlugin>, registerJsTaps: RegisterJsTaps, outputFilesystem: ThreadsafeNodeFS, intermediateFilesystem: ThreadsafeNodeFS | undefined | null, inputFilesystem: ThreadsafeNodeFS | undefined | null, resolverFactoryReference: JsResolverFactory, unsafeFastDrop: boolean, platform: RawCompilerPlatform)
|
|
332
330
|
setNonSkippableRegisters(kinds: Array<RegisterJsTapKind>): void
|
|
333
331
|
/** Build with the given option passed to the constructor */
|
|
334
332
|
build(callback: (err: null | Error) => void): void
|
|
@@ -336,7 +334,6 @@ export declare class JsCompiler {
|
|
|
336
334
|
rebuild(changed_files: string[], removed_files: string[], callback: (err: null | Error) => void): void
|
|
337
335
|
close(): Promise<void>
|
|
338
336
|
getVirtualFileStore(): VirtualFileStore | null
|
|
339
|
-
getCompilerId(): ExternalObject<CompilerId>
|
|
340
337
|
}
|
|
341
338
|
|
|
342
339
|
export declare class JsContextModuleFactoryAfterResolveData {
|
|
@@ -364,10 +361,6 @@ export declare class JsContextModuleFactoryBeforeResolveData {
|
|
|
364
361
|
set recursive(recursive: boolean)
|
|
365
362
|
}
|
|
366
363
|
|
|
367
|
-
export declare class JsCoordinator {
|
|
368
|
-
constructor(getServerCompilerIdJsFn: () => ExternalObject<CompilerId>)
|
|
369
|
-
}
|
|
370
|
-
|
|
371
364
|
export declare class JsDependencies {
|
|
372
365
|
get fileDependencies(): Array<string>
|
|
373
366
|
get addedFileDependencies(): Array<string>
|
|
@@ -563,7 +556,7 @@ export declare enum BuiltinPluginName {
|
|
|
563
556
|
RealContentHashPlugin = 'RealContentHashPlugin',
|
|
564
557
|
RemoveEmptyChunksPlugin = 'RemoveEmptyChunksPlugin',
|
|
565
558
|
EnsureChunkConditionsPlugin = 'EnsureChunkConditionsPlugin',
|
|
566
|
-
|
|
559
|
+
CaseSensitivePlugin = 'CaseSensitivePlugin',
|
|
567
560
|
DataUriPlugin = 'DataUriPlugin',
|
|
568
561
|
FileUriPlugin = 'FileUriPlugin',
|
|
569
562
|
RuntimePlugin = 'RuntimePlugin',
|
|
@@ -609,9 +602,7 @@ export declare enum BuiltinPluginName {
|
|
|
609
602
|
LazyCompilationPlugin = 'LazyCompilationPlugin',
|
|
610
603
|
ModuleInfoHeaderPlugin = 'ModuleInfoHeaderPlugin',
|
|
611
604
|
HttpUriPlugin = 'HttpUriPlugin',
|
|
612
|
-
CssChunkingPlugin = 'CssChunkingPlugin'
|
|
613
|
-
RscServerPlugin = 'RscServerPlugin',
|
|
614
|
-
RscClientPlugin = 'RscClientPlugin'
|
|
605
|
+
CssChunkingPlugin = 'CssChunkingPlugin'
|
|
615
606
|
}
|
|
616
607
|
|
|
617
608
|
export declare function cleanupGlobalTrace(): void
|
|
@@ -1838,7 +1829,6 @@ export interface RawCacheOptions {
|
|
|
1838
1829
|
|
|
1839
1830
|
export interface RawCircularDependencyRspackPluginOptions {
|
|
1840
1831
|
failOnError?: boolean
|
|
1841
|
-
allowAsyncCycles?: boolean
|
|
1842
1832
|
exclude?: RegExp
|
|
1843
1833
|
ignoredConnections?: Array<[string | RegExp, string | RegExp]>
|
|
1844
1834
|
onDetected?: (entrypoint: Module, modules: string[]) => void
|
|
@@ -1847,6 +1837,15 @@ export interface RawCircularDependencyRspackPluginOptions {
|
|
|
1847
1837
|
onEnd?: () => void
|
|
1848
1838
|
}
|
|
1849
1839
|
|
|
1840
|
+
export interface RawCompilerPlatform {
|
|
1841
|
+
web?: boolean | null
|
|
1842
|
+
browser?: boolean | null
|
|
1843
|
+
webworker?: boolean | null
|
|
1844
|
+
node?: boolean | null
|
|
1845
|
+
nwjs?: boolean | null
|
|
1846
|
+
electron?: boolean | null
|
|
1847
|
+
}
|
|
1848
|
+
|
|
1850
1849
|
export interface RawConsumeOptions {
|
|
1851
1850
|
key: string
|
|
1852
1851
|
import?: string
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Compiler } from
|
|
2
|
-
import type { InfrastructureLogging } from
|
|
1
|
+
import type { Compiler } from '..';
|
|
2
|
+
import type { InfrastructureLogging } from '../config';
|
|
3
3
|
export interface NodeEnvironmentPluginOptions {
|
|
4
4
|
infrastructureLogging: InfrastructureLogging;
|
|
5
5
|
}
|
|
@@ -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 { Compiler } from
|
|
10
|
+
import type { Compiler } from '../Compiler';
|
|
11
11
|
export type NodeTemplatePluginOptions = {
|
|
12
12
|
asyncChunkLoading?: boolean;
|
|
13
13
|
};
|
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
* Copyright (c) JS Foundation and other contributors
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
|
-
import type Watchpack from
|
|
11
|
-
import type { FileSystemInfoEntry, InputFileSystem, Watcher, WatchFileSystem } from
|
|
10
|
+
import type Watchpack from 'watchpack';
|
|
11
|
+
import type { FileSystemInfoEntry, InputFileSystem, Watcher, WatchFileSystem } from '../util/fs';
|
|
12
12
|
export default class NodeWatchFileSystem implements WatchFileSystem {
|
|
13
13
|
inputFileSystem: InputFileSystem;
|
|
14
14
|
watcherOptions: Watchpack.WatchOptions;
|
|
15
15
|
watcher?: Watchpack;
|
|
16
16
|
constructor(inputFileSystem: InputFileSystem);
|
|
17
|
-
watch(files: Iterable<string>, directories: Iterable<string>, missing: Iterable<string>, startTime: number, options: Watchpack.WatchOptions, callback: (error: Error | null, fileTimeInfoEntries: Map<string, FileSystemInfoEntry |
|
|
17
|
+
watch(files: Iterable<string>, directories: Iterable<string>, missing: Iterable<string>, 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;
|
|
18
18
|
}
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* Copyright (c) JS Foundation and other contributors
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
|
-
import type { LoggerConsole } from
|
|
11
|
-
export default function ({ colors, appendOnly, stream }: {
|
|
10
|
+
import type { LoggerConsole } from '../logging/createConsoleLogger';
|
|
11
|
+
export default function ({ colors, appendOnly, stream, }: {
|
|
12
12
|
colors?: boolean;
|
|
13
13
|
appendOnly?: boolean;
|
|
14
14
|
stream: NodeJS.WritableStream;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
var __webpack_modules__ = {};
|
|
2
|
+
var __webpack_module_cache__ = {};
|
|
3
|
+
function __webpack_require__(moduleId) {
|
|
4
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
5
|
+
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
6
|
+
var module = __webpack_module_cache__[moduleId] = {
|
|
7
|
+
exports: {}
|
|
8
|
+
};
|
|
9
|
+
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
10
|
+
return module.exports;
|
|
11
|
+
}
|
|
12
|
+
__webpack_require__.m = __webpack_modules__;
|
|
13
|
+
(()=>{
|
|
14
|
+
__webpack_require__.add = function(modules) {
|
|
15
|
+
Object.assign(__webpack_require__.m, modules);
|
|
16
|
+
};
|
|
17
|
+
})();
|
|
18
|
+
(()=>{
|
|
19
|
+
__webpack_require__.d = (exports, definition)=>{
|
|
20
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) Object.defineProperty(exports, key, {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: definition[key]
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
})();
|
|
26
|
+
(()=>{
|
|
27
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
28
|
+
})();
|
|
29
|
+
export { __webpack_require__ };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
var __webpack_modules__ = {};
|
|
2
|
+
var __webpack_module_cache__ = {};
|
|
3
|
+
function __webpack_require__(moduleId) {
|
|
4
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
5
|
+
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
6
|
+
var module = __webpack_module_cache__[moduleId] = {
|
|
7
|
+
id: moduleId,
|
|
8
|
+
loaded: false,
|
|
9
|
+
exports: {}
|
|
10
|
+
};
|
|
11
|
+
__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
12
|
+
module.loaded = true;
|
|
13
|
+
return module.exports;
|
|
14
|
+
}
|
|
15
|
+
__webpack_require__.m = __webpack_modules__;
|
|
16
|
+
(()=>{
|
|
17
|
+
__webpack_require__.add = function(modules) {
|
|
18
|
+
Object.assign(__webpack_require__.m, modules);
|
|
19
|
+
};
|
|
20
|
+
})();
|
|
21
|
+
(()=>{
|
|
22
|
+
__webpack_require__.n = (module)=>{
|
|
23
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
24
|
+
__webpack_require__.d(getter, {
|
|
25
|
+
a: getter
|
|
26
|
+
});
|
|
27
|
+
return getter;
|
|
28
|
+
};
|
|
29
|
+
})();
|
|
30
|
+
(()=>{
|
|
31
|
+
__webpack_require__.d = (exports, definition)=>{
|
|
32
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: definition[key]
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
(()=>{
|
|
39
|
+
__webpack_require__.g = (()=>{
|
|
40
|
+
if ('object' == typeof globalThis) return globalThis;
|
|
41
|
+
try {
|
|
42
|
+
return this || new Function('return this')();
|
|
43
|
+
} catch (e) {
|
|
44
|
+
if ('object' == typeof window) return window;
|
|
45
|
+
}
|
|
46
|
+
})();
|
|
47
|
+
})();
|
|
48
|
+
(()=>{
|
|
49
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
50
|
+
})();
|
|
51
|
+
(()=>{
|
|
52
|
+
__webpack_require__.r = (exports)=>{
|
|
53
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports, Symbol.toStringTag, {
|
|
54
|
+
value: 'Module'
|
|
55
|
+
});
|
|
56
|
+
Object.defineProperty(exports, '__esModule', {
|
|
57
|
+
value: true
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
})();
|
|
61
|
+
(()=>{
|
|
62
|
+
__webpack_require__.nmd = (module)=>{
|
|
63
|
+
module.paths = [];
|
|
64
|
+
if (!module.children) module.children = [];
|
|
65
|
+
return module;
|
|
66
|
+
};
|
|
67
|
+
})();
|
|
68
|
+
export { __webpack_require__ };
|
package/dist/rspack.d.ts
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
/**
|
|
2
|
+
* The following code is modified based on
|
|
3
|
+
* https://github.com/webpack/webpack/blob/4b4ca3b/lib
|
|
4
|
+
*
|
|
5
|
+
* MIT Licensed
|
|
6
|
+
* Author Tobias Koppers @sokra
|
|
7
|
+
* Copyright (c) JS Foundation and other contributors
|
|
8
|
+
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
|
+
*/
|
|
10
|
+
import type { Callback } from '@rspack/lite-tapable';
|
|
11
|
+
import { Compiler } from './Compiler';
|
|
12
|
+
import { type RspackOptions } from './config';
|
|
13
|
+
import { MultiCompiler, type MultiRspackOptions } from './MultiCompiler';
|
|
14
|
+
import MultiStats from './MultiStats';
|
|
15
|
+
import { Stats } from './Stats';
|
|
7
16
|
declare function createMultiCompiler(options: MultiRspackOptions): MultiCompiler;
|
|
8
17
|
declare function createCompiler(userOptions: RspackOptions): Compiler;
|
|
9
18
|
declare function rspack(options: MultiRspackOptions): MultiCompiler;
|
|
@@ -85,7 +85,6 @@ export const JsCompilation = __napiModule.exports.JsCompilation
|
|
|
85
85
|
export const JsCompiler = __napiModule.exports.JsCompiler
|
|
86
86
|
export const JsContextModuleFactoryAfterResolveData = __napiModule.exports.JsContextModuleFactoryAfterResolveData
|
|
87
87
|
export const JsContextModuleFactoryBeforeResolveData = __napiModule.exports.JsContextModuleFactoryBeforeResolveData
|
|
88
|
-
export const JsCoordinator = __napiModule.exports.JsCoordinator
|
|
89
88
|
export const JsDependencies = __napiModule.exports.JsDependencies
|
|
90
89
|
export const JsEntries = __napiModule.exports.JsEntries
|
|
91
90
|
export const JsExportsInfo = __napiModule.exports.JsExportsInfo
|
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type BuiltinPlugin, BuiltinPluginName } from
|
|
2
|
-
import { RspackBuiltinPlugin } from
|
|
3
|
-
import type { Compiler } from
|
|
1
|
+
import { type BuiltinPlugin, BuiltinPluginName } from '@rspack/binding';
|
|
2
|
+
import { RspackBuiltinPlugin } from '../builtin-plugin/base';
|
|
3
|
+
import type { Compiler } from '../Compiler';
|
|
4
4
|
export type ConsumeSharedPluginOptions = {
|
|
5
5
|
consumes: Consumes;
|
|
6
6
|
shareScope?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type BuiltinPlugin, BuiltinPluginName, type RawProvideOptions } from
|
|
2
|
-
import { RspackBuiltinPlugin } from
|
|
3
|
-
import type { Compiler } from
|
|
1
|
+
import { type BuiltinPlugin, BuiltinPluginName, type RawProvideOptions } from '@rspack/binding';
|
|
2
|
+
import { RspackBuiltinPlugin } from '../builtin-plugin/base';
|
|
3
|
+
import type { Compiler } from '../Compiler';
|
|
4
4
|
export type ProvideSharedPluginOptions<Enhanced extends boolean = false> = {
|
|
5
5
|
provides: Provides<Enhanced>;
|
|
6
6
|
shareScope?: string;
|
|
@@ -26,7 +26,7 @@ type ProvidesEnhancedExtraConfig = {
|
|
|
26
26
|
};
|
|
27
27
|
export declare class ProvideSharedPlugin<Enhanced extends boolean = false> extends RspackBuiltinPlugin {
|
|
28
28
|
name: BuiltinPluginName;
|
|
29
|
-
_provides: [string, Omit<RawProvideOptions,
|
|
29
|
+
_provides: [string, Omit<RawProvideOptions, 'key'>][];
|
|
30
30
|
_enhanced?: Enhanced;
|
|
31
31
|
constructor(options: ProvideSharedPluginOptions<Enhanced>);
|
|
32
32
|
raw(compiler: Compiler): BuiltinPlugin;
|