@rspack/core 0.6.5-canary-6d6fcd3-20240514084813 → 0.6.5-canary-2456d69-20240515093621
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 +1 -1
- package/dist/ChunkGroup.js +3 -3
- 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 +1 -1
- 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 +43 -43
- package/dist/builtin-plugin/index.js +43 -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 +6 -4
- package/dist/config/index.d.ts +2 -2
- package/dist/config/index.js +2 -2
- package/dist/config/normalization.d.ts +1 -2
- package/dist/config/zod.d.ts +258 -184
- package/dist/config/zod.js +8 -28
- 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 +34 -30
- package/dist/exports.js +21 -18
- 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 +14 -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 +4 -4
- package/dist/util/createSource.d.ts +0 -5
- package/dist/util/createSource.js +0 -65
package/dist/config/zod.js
CHANGED
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.rspackOptions = exports.externalsType = void 0;
|
|
4
4
|
const zod_1 = require("../../compiled/zod");
|
|
5
|
-
const util_1 = require("../util");
|
|
6
|
-
const Module_1 = require("../Module");
|
|
7
5
|
const Chunk_1 = require("../Chunk");
|
|
6
|
+
const Module_1 = require("../Module");
|
|
8
7
|
//#region Name
|
|
9
8
|
const name = zod_1.z.string();
|
|
10
9
|
//#endregion
|
|
@@ -220,19 +219,6 @@ const resolveTsconfig = zod_1.z.strictObject({
|
|
|
220
219
|
});
|
|
221
220
|
const baseResolveOptions = zod_1.z.strictObject({
|
|
222
221
|
alias: resolveAlias.optional(),
|
|
223
|
-
/**
|
|
224
|
-
* This is `aliasField: ["browser"]` in webpack, because no one
|
|
225
|
-
* uses aliasField other than "browser". ---@bvanjoi
|
|
226
|
-
*/
|
|
227
|
-
browserField: zod_1.z
|
|
228
|
-
.boolean()
|
|
229
|
-
.optional()
|
|
230
|
-
.refine(val => {
|
|
231
|
-
if (val !== undefined) {
|
|
232
|
-
(0, util_1.deprecatedWarn)(`'resolve.browserField' has been deprecated, and will be removed in 0.6.0. Please use 'resolve.aliasField' instead.`);
|
|
233
|
-
}
|
|
234
|
-
return true;
|
|
235
|
-
}),
|
|
236
222
|
conditionNames: zod_1.z.array(zod_1.z.string()).optional(),
|
|
237
223
|
extensions: zod_1.z.array(zod_1.z.string()).optional(),
|
|
238
224
|
fallback: resolveAlias.optional(),
|
|
@@ -385,19 +371,23 @@ const cssGeneratorExportsConvention = zod_1.z.enum([
|
|
|
385
371
|
]);
|
|
386
372
|
const cssGeneratorExportsOnly = zod_1.z.boolean();
|
|
387
373
|
const cssGeneratorLocalIdentName = zod_1.z.string();
|
|
374
|
+
const cssGeneratorEsModule = zod_1.z.boolean();
|
|
388
375
|
const cssGeneratorOptions = zod_1.z.strictObject({
|
|
389
376
|
exportsConvention: cssGeneratorExportsConvention.optional(),
|
|
390
|
-
exportsOnly: cssGeneratorExportsOnly.optional()
|
|
377
|
+
exportsOnly: cssGeneratorExportsOnly.optional(),
|
|
378
|
+
esModule: cssGeneratorEsModule.optional()
|
|
391
379
|
});
|
|
392
380
|
const cssAutoGeneratorOptions = zod_1.z.strictObject({
|
|
393
381
|
exportsConvention: cssGeneratorExportsConvention.optional(),
|
|
394
382
|
exportsOnly: cssGeneratorExportsOnly.optional(),
|
|
395
|
-
localIdentName: cssGeneratorLocalIdentName.optional()
|
|
383
|
+
localIdentName: cssGeneratorLocalIdentName.optional(),
|
|
384
|
+
esModule: cssGeneratorEsModule.optional()
|
|
396
385
|
});
|
|
397
386
|
const cssModuleGeneratorOptions = zod_1.z.strictObject({
|
|
398
387
|
exportsConvention: cssGeneratorExportsConvention.optional(),
|
|
399
388
|
exportsOnly: cssGeneratorExportsOnly.optional(),
|
|
400
|
-
localIdentName: cssGeneratorLocalIdentName.optional()
|
|
389
|
+
localIdentName: cssGeneratorLocalIdentName.optional(),
|
|
390
|
+
esModule: cssGeneratorEsModule.optional()
|
|
401
391
|
});
|
|
402
392
|
const generatorOptionsByModuleTypeKnown = zod_1.z.strictObject({
|
|
403
393
|
asset: assetGeneratorOptions.optional(),
|
|
@@ -764,16 +754,6 @@ const experiments = zod_1.z.strictObject({
|
|
|
764
754
|
asyncWebAssembly: zod_1.z.boolean().optional(),
|
|
765
755
|
outputModule: zod_1.z.boolean().optional(),
|
|
766
756
|
topLevelAwait: zod_1.z.boolean().optional(),
|
|
767
|
-
newSplitChunks: zod_1.z
|
|
768
|
-
.boolean()
|
|
769
|
-
.optional()
|
|
770
|
-
.refine(val => {
|
|
771
|
-
if (val === false) {
|
|
772
|
-
(0, util_1.deprecatedWarn)(`'experiments.newSplitChunks = ${JSON.stringify(val)}' has been deprecated, please switch to 'experiments.newSplitChunks = true' to use webpack's behavior.
|
|
773
|
-
See the discussion here (https://github.com/web-infra-dev/rspack/discussions/4168)`);
|
|
774
|
-
}
|
|
775
|
-
return true;
|
|
776
|
-
}),
|
|
777
757
|
css: zod_1.z.boolean().optional(),
|
|
778
758
|
futureDefaults: zod_1.z.boolean().optional(),
|
|
779
759
|
rspackFuture: rspackFutureOptions.optional()
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BuiltinPlugin, BuiltinPluginName } from "@rspack/binding";
|
|
2
2
|
import { RspackBuiltinPlugin } from "../builtin-plugin/base";
|
|
3
|
-
import { EntryRuntime, FilenameTemplate, LibraryOptions } from "../config";
|
|
4
3
|
import { Compiler } from "../Compiler";
|
|
4
|
+
import { EntryRuntime, FilenameTemplate, LibraryOptions } from "../config";
|
|
5
5
|
export type ContainerPluginOptions = {
|
|
6
6
|
exposes: Exposes;
|
|
7
7
|
filename?: FilenameTemplate;
|
|
@@ -21,7 +21,7 @@ export type RemotesConfig = {
|
|
|
21
21
|
export declare class ContainerReferencePlugin extends RspackBuiltinPlugin {
|
|
22
22
|
name: BuiltinPluginName;
|
|
23
23
|
_options: {
|
|
24
|
-
remoteType: "promise" | "
|
|
24
|
+
remoteType: "promise" | "commonjs" | "umd" | "amd" | "module" | "global" | "jsonp" | "import" | "commonjs2" | "var" | "assign" | "this" | "window" | "self" | "commonjs-module" | "commonjs-static" | "amd-require" | "umd2" | "system" | "script" | "node-commonjs";
|
|
25
25
|
remotes: [string, {
|
|
26
26
|
external: string[];
|
|
27
27
|
shareScope: string;
|
|
@@ -4,8 +4,8 @@ exports.ContainerReferencePlugin = void 0;
|
|
|
4
4
|
const binding_1 = require("@rspack/binding");
|
|
5
5
|
const base_1 = require("../builtin-plugin/base");
|
|
6
6
|
const ExternalsPlugin_1 = require("../builtin-plugin/ExternalsPlugin");
|
|
7
|
-
const options_1 = require("./options");
|
|
8
7
|
const ShareRuntimePlugin_1 = require("../sharing/ShareRuntimePlugin");
|
|
8
|
+
const options_1 = require("./options");
|
|
9
9
|
class ContainerReferencePlugin extends base_1.RspackBuiltinPlugin {
|
|
10
10
|
constructor(options) {
|
|
11
11
|
var _a;
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ModuleFederationPlugin = void 0;
|
|
4
4
|
const config_1 = require("../config");
|
|
5
|
-
const options_1 = require("./options");
|
|
6
5
|
const validate_1 = require("../util/validate");
|
|
7
6
|
const ModuleFederationRuntimePlugin_1 = require("./ModuleFederationRuntimePlugin");
|
|
7
|
+
const options_1 = require("./options");
|
|
8
8
|
class ModuleFederationPlugin {
|
|
9
9
|
constructor(_options) {
|
|
10
10
|
this._options = _options;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Compiler } from "../Compiler";
|
|
2
|
-
import {
|
|
2
|
+
import { EntryRuntime, ExternalsType, LibraryOptions } from "../config";
|
|
3
3
|
import { Shared } from "../sharing/SharePlugin";
|
|
4
4
|
import { Exposes } from "./ContainerPlugin";
|
|
5
5
|
import { Remotes } from "./ContainerReferencePlugin";
|
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ModuleFederationPluginV1 = void 0;
|
|
4
4
|
const config_1 = require("../config");
|
|
5
5
|
const SharePlugin_1 = require("../sharing/SharePlugin");
|
|
6
|
+
const ShareRuntimePlugin_1 = require("../sharing/ShareRuntimePlugin");
|
|
6
7
|
const validate_1 = require("../util/validate");
|
|
7
8
|
const ContainerPlugin_1 = require("./ContainerPlugin");
|
|
8
9
|
const ContainerReferencePlugin_1 = require("./ContainerReferencePlugin");
|
|
9
|
-
const ShareRuntimePlugin_1 = require("../sharing/ShareRuntimePlugin");
|
|
10
10
|
class ModuleFederationPluginV1 {
|
|
11
11
|
constructor(_options) {
|
|
12
12
|
this._options = _options;
|
|
@@ -3,7 +3,7 @@ export declare const ModuleFederationRuntimePlugin: {
|
|
|
3
3
|
new (): {
|
|
4
4
|
name: BuiltinPluginName;
|
|
5
5
|
_options: void;
|
|
6
|
-
affectedHooks: "done" | "
|
|
6
|
+
affectedHooks: "done" | "make" | "compile" | "emit" | "afterEmit" | "invalid" | "thisCompilation" | "afterDone" | "compilation" | "normalModuleFactory" | "contextModuleFactory" | "initialize" | "shouldEmit" | "infrastructureLog" | "beforeRun" | "run" | "assetEmitted" | "failed" | "shutdown" | "watchRun" | "watchClose" | "environment" | "afterEnvironment" | "afterPlugins" | "afterResolvers" | "beforeCompile" | "afterCompile" | "finishMake" | "entryOption" | undefined;
|
|
7
7
|
raw(): import("@rspack/binding").BuiltinPlugin;
|
|
8
8
|
apply(compiler: import("../Compiler").Compiler): void;
|
|
9
9
|
};
|
package/dist/exports.d.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
declare const rspackVersion: any, webpackVersion: any;
|
|
2
|
-
export { webpackVersion as version
|
|
3
|
-
export {
|
|
2
|
+
export { rspackVersion, webpackVersion as version };
|
|
3
|
+
export type { Asset, AssetInfo, Assets, CompilationParams, LogEntry } from "./Compilation";
|
|
4
4
|
export { Compilation } from "./Compilation";
|
|
5
|
-
export
|
|
6
|
-
export { MultiCompiler } from "./MultiCompiler";
|
|
5
|
+
export { Compiler } from "./Compiler";
|
|
7
6
|
export type { MultiCompilerOptions, MultiRspackOptions } from "./MultiCompiler";
|
|
7
|
+
export { MultiCompiler } from "./MultiCompiler";
|
|
8
8
|
import { RspackOptionsApply } from "./rspackOptionsApply";
|
|
9
9
|
export { RspackOptionsApply, RspackOptionsApply as WebpackOptionsApply };
|
|
10
|
-
export { RuntimeGlobals } from "./RuntimeGlobals";
|
|
11
|
-
export { Stats } from "./Stats";
|
|
12
|
-
export type { StatsCompilation, StatsAsset, StatsChunk, StatsError, StatsModule, StatsWarnings } from "./Stats";
|
|
13
|
-
export { MultiStats } from "./MultiStats";
|
|
14
10
|
export type { Chunk } from "./Chunk";
|
|
15
11
|
export type { ChunkGroup } from "./ChunkGroup";
|
|
16
|
-
export type { NormalModuleFactory } from "./NormalModuleFactory";
|
|
17
12
|
export type { Module } from "./Module";
|
|
13
|
+
export { MultiStats } from "./MultiStats";
|
|
18
14
|
export { NormalModule } from "./NormalModule";
|
|
15
|
+
export type { NormalModuleFactory } from "./NormalModuleFactory";
|
|
16
|
+
export { RuntimeGlobals } from "./RuntimeGlobals";
|
|
17
|
+
export type { StatsAsset, StatsChunk, StatsCompilation, StatsError, StatsModule, StatsWarnings } from "./Stats";
|
|
18
|
+
export { Stats } from "./Stats";
|
|
19
19
|
import * as ModuleFilenameHelpers from "./lib/ModuleFilenameHelpers";
|
|
20
20
|
export { ModuleFilenameHelpers };
|
|
21
21
|
import Template = require("./Template");
|
|
@@ -24,7 +24,7 @@ export declare const WebpackError: ErrorConstructor;
|
|
|
24
24
|
export type { Watching } from "./Watching";
|
|
25
25
|
declare const sources: any;
|
|
26
26
|
export { sources };
|
|
27
|
-
import {
|
|
27
|
+
import { applyRspackOptionsDefaults, getNormalizedRspackOptions } from "./config";
|
|
28
28
|
type Config = {
|
|
29
29
|
getNormalizedRspackOptions: typeof getNormalizedRspackOptions;
|
|
30
30
|
applyRspackOptionsDefaults: typeof applyRspackOptionsDefaults;
|
|
@@ -37,31 +37,34 @@ export declare const util: {
|
|
|
37
37
|
createHash: (algorithm: any) => any;
|
|
38
38
|
cleverMerge: <T, O>(first: T, second: O) => T | O | (T & O);
|
|
39
39
|
};
|
|
40
|
-
export { registerGlobalTrace as experimental_registerGlobalTrace, cleanupGlobalTrace as experimental_cleanupGlobalTrace } from "@rspack/binding";
|
|
41
40
|
export { default as EntryOptionPlugin } from "./lib/EntryOptionPlugin";
|
|
42
|
-
export {
|
|
41
|
+
export { type OutputFileSystem } from "./util/fs";
|
|
42
|
+
export { cleanupGlobalTrace as experimental_cleanupGlobalTrace, registerGlobalTrace as experimental_registerGlobalTrace } from "@rspack/binding";
|
|
43
43
|
export type { BannerPluginArgument } from "./builtin-plugin";
|
|
44
|
+
export type { ProvidePluginOptions } from "./builtin-plugin";
|
|
45
|
+
export type { DefinePluginOptions } from "./builtin-plugin";
|
|
46
|
+
export type { ProgressPluginArgument } from "./builtin-plugin";
|
|
47
|
+
export type { EntryOptions } from "./builtin-plugin";
|
|
48
|
+
export { BannerPlugin } from "./builtin-plugin";
|
|
44
49
|
export { IgnorePlugin, type IgnorePluginOptions } from "./builtin-plugin";
|
|
45
50
|
export { ProvidePlugin } from "./builtin-plugin";
|
|
46
|
-
export type { ProvidePluginOptions } from "./builtin-plugin";
|
|
47
51
|
export { DefinePlugin } from "./builtin-plugin";
|
|
48
|
-
export type { DefinePluginOptions } from "./builtin-plugin";
|
|
49
52
|
export { ProgressPlugin } from "./builtin-plugin";
|
|
50
|
-
export type { ProgressPluginArgument } from "./builtin-plugin";
|
|
51
53
|
export { EntryPlugin } from "./builtin-plugin";
|
|
52
|
-
export type { EntryOptions } from "./builtin-plugin";
|
|
53
54
|
export { DynamicEntryPlugin } from "./builtin-plugin";
|
|
54
55
|
export { ExternalsPlugin } from "./builtin-plugin";
|
|
55
56
|
export { HotModuleReplacementPlugin } from "./builtin-plugin";
|
|
57
|
+
export { EnvironmentPlugin } from "./lib/EnvironmentPlugin";
|
|
56
58
|
export { LoaderOptionsPlugin } from "./lib/LoaderOptionsPlugin";
|
|
57
59
|
export { LoaderTargetPlugin } from "./lib/LoaderTargetPlugin";
|
|
58
|
-
export { EnvironmentPlugin } from "./lib/EnvironmentPlugin";
|
|
59
60
|
export { NormalModuleReplacementPlugin } from "./lib/NormalModuleReplacementPlugin";
|
|
60
|
-
import NodeTemplatePlugin from "./node/NodeTemplatePlugin";
|
|
61
61
|
import { NodeTargetPlugin } from "./builtin-plugin";
|
|
62
|
+
import NodeEnvironmentPlugin from "./node/NodeEnvironmentPlugin";
|
|
63
|
+
import NodeTemplatePlugin from "./node/NodeTemplatePlugin";
|
|
62
64
|
interface Node {
|
|
63
65
|
NodeTargetPlugin: typeof NodeTargetPlugin;
|
|
64
66
|
NodeTemplatePlugin: typeof NodeTemplatePlugin;
|
|
67
|
+
NodeEnvironmentPlugin: typeof NodeEnvironmentPlugin;
|
|
65
68
|
}
|
|
66
69
|
export declare const node: Node;
|
|
67
70
|
import { ElectronTargetPlugin } from "./builtin-plugin";
|
|
@@ -104,36 +107,37 @@ import { ModuleFederationPluginV1 } from "./container/ModuleFederationPluginV1";
|
|
|
104
107
|
export type { ModuleFederationPluginV1Options } from "./container/ModuleFederationPluginV1";
|
|
105
108
|
import { ContainerPlugin } from "./container/ContainerPlugin";
|
|
106
109
|
import { ContainerReferencePlugin } from "./container/ContainerReferencePlugin";
|
|
107
|
-
export type { ContainerPluginOptions, Exposes, ExposesItem, ExposesItems, ExposesObject
|
|
108
|
-
export type { ContainerReferencePluginOptions, Remotes, RemotesItem, RemotesItems, RemotesObject
|
|
110
|
+
export type { ContainerPluginOptions, Exposes, ExposesConfig, ExposesItem, ExposesItems, ExposesObject } from "./container/ContainerPlugin";
|
|
111
|
+
export type { ContainerReferencePluginOptions, Remotes, RemotesConfig, RemotesItem, RemotesItems, RemotesObject } from "./container/ContainerReferencePlugin";
|
|
109
112
|
export declare const container: {
|
|
110
113
|
ContainerPlugin: typeof ContainerPlugin;
|
|
111
114
|
ContainerReferencePlugin: typeof ContainerReferencePlugin;
|
|
112
115
|
ModuleFederationPlugin: typeof ModuleFederationPlugin;
|
|
113
116
|
ModuleFederationPluginV1: typeof ModuleFederationPluginV1;
|
|
114
117
|
};
|
|
115
|
-
import { ProvideSharedPlugin } from "./sharing/ProvideSharedPlugin";
|
|
116
118
|
import { ConsumeSharedPlugin } from "./sharing/ConsumeSharedPlugin";
|
|
119
|
+
import { ProvideSharedPlugin } from "./sharing/ProvideSharedPlugin";
|
|
117
120
|
import { SharePlugin } from "./sharing/SharePlugin";
|
|
118
|
-
export type {
|
|
119
|
-
export type {
|
|
120
|
-
export type {
|
|
121
|
+
export type { Consumes, ConsumesConfig, ConsumeSharedPluginOptions, ConsumesItem, ConsumesObject } from "./sharing/ConsumeSharedPlugin";
|
|
122
|
+
export type { Provides, ProvidesConfig, ProvideSharedPluginOptions, ProvidesItem, ProvidesObject } from "./sharing/ProvideSharedPlugin";
|
|
123
|
+
export type { Shared, SharedConfig, SharedItem, SharedObject, SharePluginOptions } from "./sharing/SharePlugin";
|
|
121
124
|
export declare const sharing: {
|
|
122
125
|
ProvideSharedPlugin: typeof ProvideSharedPlugin;
|
|
123
126
|
ConsumeSharedPlugin: typeof ConsumeSharedPlugin;
|
|
124
127
|
SharePlugin: typeof SharePlugin;
|
|
125
128
|
};
|
|
126
|
-
export { HtmlRspackPlugin } from "./builtin-plugin";
|
|
127
129
|
export type { HtmlRspackPluginOptions } from "./builtin-plugin";
|
|
128
|
-
export { SwcJsMinimizerRspackPlugin } from "./builtin-plugin";
|
|
129
130
|
export type { SwcJsMinimizerRspackPluginOptions } from "./builtin-plugin";
|
|
131
|
+
export type { CopyRspackPluginOptions } from "./builtin-plugin";
|
|
132
|
+
export type { SourceMapDevToolPluginOptions } from "./builtin-plugin";
|
|
133
|
+
export type { EvalDevToolModulePluginOptions } from "./builtin-plugin";
|
|
134
|
+
export type { CssExtractRspackLoaderOptions, CssExtractRspackPluginOptions } from "./builtin-plugin";
|
|
135
|
+
export { HtmlRspackPlugin } from "./builtin-plugin";
|
|
136
|
+
export { SwcJsMinimizerRspackPlugin } from "./builtin-plugin";
|
|
130
137
|
export { SwcCssMinimizerRspackPlugin } from "./builtin-plugin";
|
|
131
138
|
export { CopyRspackPlugin } from "./builtin-plugin";
|
|
132
|
-
export type { CopyRspackPluginOptions } from "./builtin-plugin";
|
|
133
139
|
export { SourceMapDevToolPlugin } from "./builtin-plugin";
|
|
134
140
|
export { EvalSourceMapDevToolPlugin } from "./builtin-plugin";
|
|
135
|
-
export type { SourceMapDevToolPluginOptions } from "./builtin-plugin";
|
|
136
141
|
export { EvalDevToolModulePlugin } from "./builtin-plugin";
|
|
137
|
-
export type { EvalDevToolModulePluginOptions } from "./builtin-plugin";
|
|
138
142
|
export { CssExtractRspackPlugin } from "./builtin-plugin";
|
|
139
|
-
export type {
|
|
143
|
+
export type { SwcLoaderEnvConfig, SwcLoaderEsParserConfig, SwcLoaderJscConfig, SwcLoaderModuleConfig, SwcLoaderOptions, SwcLoaderParserConfig, SwcLoaderTransformConfig, SwcLoaderTsParserConfig } from "./builtin-loader/swc/index";
|
package/dist/exports.js
CHANGED
|
@@ -26,27 +26,27 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.CssExtractRspackPlugin = exports.EvalDevToolModulePlugin = exports.EvalSourceMapDevToolPlugin = exports.SourceMapDevToolPlugin = exports.CopyRspackPlugin = exports.SwcCssMinimizerRspackPlugin = exports.SwcJsMinimizerRspackPlugin = exports.HtmlRspackPlugin = exports.sharing = exports.container = exports.optimize = exports.webworker = exports.javascript = exports.wasm = exports.library = exports.electron = exports.node = exports.NormalModuleReplacementPlugin = exports.
|
|
29
|
+
exports.CssExtractRspackPlugin = exports.EvalDevToolModulePlugin = exports.EvalSourceMapDevToolPlugin = exports.SourceMapDevToolPlugin = exports.CopyRspackPlugin = exports.SwcCssMinimizerRspackPlugin = exports.SwcJsMinimizerRspackPlugin = exports.HtmlRspackPlugin = exports.sharing = exports.container = exports.optimize = exports.webworker = exports.javascript = exports.wasm = exports.library = exports.electron = exports.node = exports.NormalModuleReplacementPlugin = exports.LoaderTargetPlugin = exports.LoaderOptionsPlugin = exports.EnvironmentPlugin = exports.HotModuleReplacementPlugin = exports.ExternalsPlugin = exports.DynamicEntryPlugin = exports.EntryPlugin = exports.ProgressPlugin = exports.DefinePlugin = exports.ProvidePlugin = exports.IgnorePlugin = exports.BannerPlugin = exports.experimental_registerGlobalTrace = exports.experimental_cleanupGlobalTrace = exports.EntryOptionPlugin = exports.util = exports.config = exports.sources = exports.WebpackError = exports.Template = exports.ModuleFilenameHelpers = exports.Stats = exports.RuntimeGlobals = exports.NormalModule = exports.MultiStats = exports.WebpackOptionsApply = exports.RspackOptionsApply = exports.MultiCompiler = exports.Compiler = exports.Compilation = exports.version = exports.rspackVersion = void 0;
|
|
30
30
|
const { version: rspackVersion, webpackVersion } = require("../package.json");
|
|
31
31
|
exports.rspackVersion = rspackVersion;
|
|
32
32
|
exports.version = webpackVersion;
|
|
33
|
-
var Compiler_1 = require("./Compiler");
|
|
34
|
-
Object.defineProperty(exports, "Compiler", { enumerable: true, get: function () { return Compiler_1.Compiler; } });
|
|
35
33
|
var Compilation_1 = require("./Compilation");
|
|
36
34
|
Object.defineProperty(exports, "Compilation", { enumerable: true, get: function () { return Compilation_1.Compilation; } });
|
|
35
|
+
var Compiler_1 = require("./Compiler");
|
|
36
|
+
Object.defineProperty(exports, "Compiler", { enumerable: true, get: function () { return Compiler_1.Compiler; } });
|
|
37
37
|
var MultiCompiler_1 = require("./MultiCompiler");
|
|
38
38
|
Object.defineProperty(exports, "MultiCompiler", { enumerable: true, get: function () { return MultiCompiler_1.MultiCompiler; } });
|
|
39
39
|
const rspackOptionsApply_1 = require("./rspackOptionsApply");
|
|
40
40
|
Object.defineProperty(exports, "RspackOptionsApply", { enumerable: true, get: function () { return rspackOptionsApply_1.RspackOptionsApply; } });
|
|
41
41
|
Object.defineProperty(exports, "WebpackOptionsApply", { enumerable: true, get: function () { return rspackOptionsApply_1.RspackOptionsApply; } });
|
|
42
|
-
var RuntimeGlobals_1 = require("./RuntimeGlobals");
|
|
43
|
-
Object.defineProperty(exports, "RuntimeGlobals", { enumerable: true, get: function () { return RuntimeGlobals_1.RuntimeGlobals; } });
|
|
44
|
-
var Stats_1 = require("./Stats");
|
|
45
|
-
Object.defineProperty(exports, "Stats", { enumerable: true, get: function () { return Stats_1.Stats; } });
|
|
46
42
|
var MultiStats_1 = require("./MultiStats");
|
|
47
43
|
Object.defineProperty(exports, "MultiStats", { enumerable: true, get: function () { return MultiStats_1.MultiStats; } });
|
|
48
44
|
var NormalModule_1 = require("./NormalModule");
|
|
49
45
|
Object.defineProperty(exports, "NormalModule", { enumerable: true, get: function () { return NormalModule_1.NormalModule; } });
|
|
46
|
+
var RuntimeGlobals_1 = require("./RuntimeGlobals");
|
|
47
|
+
Object.defineProperty(exports, "RuntimeGlobals", { enumerable: true, get: function () { return RuntimeGlobals_1.RuntimeGlobals; } });
|
|
48
|
+
var Stats_1 = require("./Stats");
|
|
49
|
+
Object.defineProperty(exports, "Stats", { enumerable: true, get: function () { return Stats_1.Stats; } });
|
|
50
50
|
// API extractor not working with some re-exports, see: https://github.com/microsoft/fluentui/issues/20694
|
|
51
51
|
const ModuleFilenameHelpers = __importStar(require("./lib/ModuleFilenameHelpers"));
|
|
52
52
|
exports.ModuleFilenameHelpers = ModuleFilenameHelpers;
|
|
@@ -63,15 +63,14 @@ exports.config = {
|
|
|
63
63
|
getNormalizedWebpackOptions: config_1.getNormalizedRspackOptions,
|
|
64
64
|
applyWebpackOptionsDefaults: config_1.applyRspackOptionsDefaults
|
|
65
65
|
};
|
|
66
|
-
const createHash_1 = require("./util/createHash");
|
|
67
66
|
const cleverMerge_1 = require("./util/cleverMerge");
|
|
67
|
+
const createHash_1 = require("./util/createHash");
|
|
68
68
|
exports.util = { createHash: createHash_1.createHash, cleverMerge: cleverMerge_1.cachedCleverMerge };
|
|
69
|
-
var binding_1 = require("@rspack/binding");
|
|
70
|
-
Object.defineProperty(exports, "experimental_registerGlobalTrace", { enumerable: true, get: function () { return binding_1.registerGlobalTrace; } });
|
|
71
|
-
Object.defineProperty(exports, "experimental_cleanupGlobalTrace", { enumerable: true, get: function () { return binding_1.cleanupGlobalTrace; } });
|
|
72
69
|
var EntryOptionPlugin_1 = require("./lib/EntryOptionPlugin");
|
|
73
70
|
Object.defineProperty(exports, "EntryOptionPlugin", { enumerable: true, get: function () { return __importDefault(EntryOptionPlugin_1).default; } });
|
|
74
|
-
|
|
71
|
+
var binding_1 = require("@rspack/binding");
|
|
72
|
+
Object.defineProperty(exports, "experimental_cleanupGlobalTrace", { enumerable: true, get: function () { return binding_1.cleanupGlobalTrace; } });
|
|
73
|
+
Object.defineProperty(exports, "experimental_registerGlobalTrace", { enumerable: true, get: function () { return binding_1.registerGlobalTrace; } });
|
|
75
74
|
var builtin_plugin_1 = require("./builtin-plugin");
|
|
76
75
|
Object.defineProperty(exports, "BannerPlugin", { enumerable: true, get: function () { return builtin_plugin_1.BannerPlugin; } });
|
|
77
76
|
var builtin_plugin_2 = require("./builtin-plugin");
|
|
@@ -90,17 +89,22 @@ var builtin_plugin_8 = require("./builtin-plugin");
|
|
|
90
89
|
Object.defineProperty(exports, "ExternalsPlugin", { enumerable: true, get: function () { return builtin_plugin_8.ExternalsPlugin; } });
|
|
91
90
|
var builtin_plugin_9 = require("./builtin-plugin");
|
|
92
91
|
Object.defineProperty(exports, "HotModuleReplacementPlugin", { enumerable: true, get: function () { return builtin_plugin_9.HotModuleReplacementPlugin; } });
|
|
92
|
+
var EnvironmentPlugin_1 = require("./lib/EnvironmentPlugin");
|
|
93
|
+
Object.defineProperty(exports, "EnvironmentPlugin", { enumerable: true, get: function () { return EnvironmentPlugin_1.EnvironmentPlugin; } });
|
|
93
94
|
var LoaderOptionsPlugin_1 = require("./lib/LoaderOptionsPlugin");
|
|
94
95
|
Object.defineProperty(exports, "LoaderOptionsPlugin", { enumerable: true, get: function () { return LoaderOptionsPlugin_1.LoaderOptionsPlugin; } });
|
|
95
96
|
var LoaderTargetPlugin_1 = require("./lib/LoaderTargetPlugin");
|
|
96
97
|
Object.defineProperty(exports, "LoaderTargetPlugin", { enumerable: true, get: function () { return LoaderTargetPlugin_1.LoaderTargetPlugin; } });
|
|
97
|
-
var EnvironmentPlugin_1 = require("./lib/EnvironmentPlugin");
|
|
98
|
-
Object.defineProperty(exports, "EnvironmentPlugin", { enumerable: true, get: function () { return EnvironmentPlugin_1.EnvironmentPlugin; } });
|
|
99
98
|
var NormalModuleReplacementPlugin_1 = require("./lib/NormalModuleReplacementPlugin");
|
|
100
99
|
Object.defineProperty(exports, "NormalModuleReplacementPlugin", { enumerable: true, get: function () { return NormalModuleReplacementPlugin_1.NormalModuleReplacementPlugin; } });
|
|
101
|
-
const NodeTemplatePlugin_1 = __importDefault(require("./node/NodeTemplatePlugin"));
|
|
102
100
|
const builtin_plugin_10 = require("./builtin-plugin");
|
|
103
|
-
|
|
101
|
+
const NodeEnvironmentPlugin_1 = __importDefault(require("./node/NodeEnvironmentPlugin"));
|
|
102
|
+
const NodeTemplatePlugin_1 = __importDefault(require("./node/NodeTemplatePlugin"));
|
|
103
|
+
exports.node = {
|
|
104
|
+
NodeTargetPlugin: builtin_plugin_10.NodeTargetPlugin,
|
|
105
|
+
NodeTemplatePlugin: NodeTemplatePlugin_1.default,
|
|
106
|
+
NodeEnvironmentPlugin: NodeEnvironmentPlugin_1.default
|
|
107
|
+
};
|
|
104
108
|
const builtin_plugin_11 = require("./builtin-plugin");
|
|
105
109
|
exports.electron = { ElectronTargetPlugin: builtin_plugin_11.ElectronTargetPlugin };
|
|
106
110
|
const builtin_plugin_12 = require("./builtin-plugin");
|
|
@@ -129,15 +133,14 @@ exports.container = {
|
|
|
129
133
|
ModuleFederationPlugin: ModuleFederationPlugin_1.ModuleFederationPlugin,
|
|
130
134
|
ModuleFederationPluginV1: ModuleFederationPluginV1_1.ModuleFederationPluginV1
|
|
131
135
|
};
|
|
132
|
-
const ProvideSharedPlugin_1 = require("./sharing/ProvideSharedPlugin");
|
|
133
136
|
const ConsumeSharedPlugin_1 = require("./sharing/ConsumeSharedPlugin");
|
|
137
|
+
const ProvideSharedPlugin_1 = require("./sharing/ProvideSharedPlugin");
|
|
134
138
|
const SharePlugin_1 = require("./sharing/SharePlugin");
|
|
135
139
|
exports.sharing = {
|
|
136
140
|
ProvideSharedPlugin: ProvideSharedPlugin_1.ProvideSharedPlugin,
|
|
137
141
|
ConsumeSharedPlugin: ConsumeSharedPlugin_1.ConsumeSharedPlugin,
|
|
138
142
|
SharePlugin: SharePlugin_1.SharePlugin
|
|
139
143
|
};
|
|
140
|
-
///// Rspack Postfixed Internal Plugins /////
|
|
141
144
|
var builtin_plugin_19 = require("./builtin-plugin");
|
|
142
145
|
Object.defineProperty(exports, "HtmlRspackPlugin", { enumerable: true, get: function () { return builtin_plugin_19.HtmlRspackPlugin; } });
|
|
143
146
|
var builtin_plugin_20 = require("./builtin-plugin");
|
package/dist/fileSystem.d.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { ThreadsafeNodeFS } from "@rspack/binding";
|
|
3
|
+
import { OutputFileSystem } from "./util/fs";
|
|
4
|
+
declare class ThreadsafeWritableNodeFS implements ThreadsafeNodeFS {
|
|
5
|
+
writeFile: (name: string, content: Buffer) => Promise<void> | void;
|
|
6
|
+
removeFile: (name: string) => Promise<void> | void;
|
|
7
|
+
mkdir: (name: string) => Promise<void> | void;
|
|
8
|
+
mkdirp: (name: string) => Promise<string | void> | string | void;
|
|
9
|
+
removeDirAll: (name: string) => Promise<string | void> | string | void;
|
|
10
|
+
constructor(fs?: OutputFileSystem);
|
|
11
|
+
static __into_binding(fs?: OutputFileSystem): ThreadsafeWritableNodeFS;
|
|
7
12
|
}
|
|
8
|
-
|
|
9
|
-
export { createThreadsafeNodeFSFromRaw };
|
|
13
|
+
export { ThreadsafeWritableNodeFS };
|
package/dist/fileSystem.js
CHANGED
|
@@ -3,55 +3,32 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.ThreadsafeWritableNodeFS = void 0;
|
|
7
7
|
const util_1 = __importDefault(require("util"));
|
|
8
|
-
const
|
|
8
|
+
const fs_1 = require("./util/fs");
|
|
9
9
|
const memoize_1 = require("./util/memoize");
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
removeDirAll: dir => {
|
|
24
|
-
// memfs don't support rmSync
|
|
25
|
-
return rmrfBuild(fs)(dir);
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
exports.createThreadsafeNodeFSFromRaw = createThreadsafeNodeFSFromRaw;
|
|
30
|
-
const rmrfBuild = (fs) => {
|
|
31
|
-
async function exists(path) {
|
|
32
|
-
try {
|
|
33
|
-
await util_1.default.promisify(fs.access.bind(fs))(path);
|
|
34
|
-
return true;
|
|
35
|
-
}
|
|
36
|
-
catch (_a) {
|
|
37
|
-
return false;
|
|
10
|
+
const NOOP_FILESYSTEM = {
|
|
11
|
+
writeFile() { },
|
|
12
|
+
removeFile() { },
|
|
13
|
+
mkdir() { },
|
|
14
|
+
mkdirp() { },
|
|
15
|
+
removeDirAll() { }
|
|
16
|
+
};
|
|
17
|
+
class ThreadsafeWritableNodeFS {
|
|
18
|
+
constructor(fs) {
|
|
19
|
+
if (!fs) {
|
|
20
|
+
// This happens when located in a child compiler.
|
|
21
|
+
Object.assign(this, NOOP_FILESYSTEM);
|
|
22
|
+
return;
|
|
38
23
|
}
|
|
24
|
+
this.writeFile = (0, memoize_1.memoizeFn)(() => util_1.default.promisify(fs.writeFile.bind(fs)));
|
|
25
|
+
this.removeFile = (0, memoize_1.memoizeFn)(() => util_1.default.promisify(fs.unlink.bind(fs)));
|
|
26
|
+
this.mkdir = (0, memoize_1.memoizeFn)(() => util_1.default.promisify(fs.mkdir.bind(fs)));
|
|
27
|
+
this.mkdirp = (0, memoize_1.memoizeFn)(() => util_1.default.promisify(fs_1.mkdirp.bind(null, fs)));
|
|
28
|
+
this.removeDirAll = (0, memoize_1.memoizeFn)(() => util_1.default.promisify(fs_1.rmrf.bind(null, fs)));
|
|
39
29
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
.map(async (filePath) => {
|
|
46
|
-
if ((await util_1.default.promisify(fs.lstat.bind(fs))(filePath)).isDirectory()) {
|
|
47
|
-
await rmrf(filePath);
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
await util_1.default.promisify(fs.unlink.bind(fs))(filePath);
|
|
51
|
-
}
|
|
52
|
-
}));
|
|
53
|
-
await util_1.default.promisify(fs.rmdir.bind(fs))(dir);
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
return rmrf;
|
|
57
|
-
};
|
|
30
|
+
static __into_binding(fs) {
|
|
31
|
+
return new this(fs);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.ThreadsafeWritableNodeFS = ThreadsafeWritableNodeFS;
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -27,8 +27,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.rspack = void 0;
|
|
30
|
-
const rspack_1 = require("./rspack");
|
|
31
30
|
const rspackExports = __importStar(require("./exports"));
|
|
31
|
+
const rspack_1 = require("./rspack");
|
|
32
32
|
const fn = Object.assign(rspack_1.rspack, rspackExports);
|
|
33
33
|
fn.rspack = fn;
|
|
34
34
|
fn.webpack = fn;
|
|
@@ -112,6 +112,12 @@ export declare class AsyncSeriesBailHook<T, R, AdditionalOptions = UnsetAddition
|
|
|
112
112
|
tapAsync(options: Options<AdditionalOptions>, fn: FnWithCallback<T, void>): void;
|
|
113
113
|
tapPromise(options: Options<AdditionalOptions>, fn: Fn<T, void>): void;
|
|
114
114
|
}
|
|
115
|
+
export declare class AsyncSeriesWaterfallHook<T, R, AdditionalOptions = UnsetAdditionalOptions> extends Hook<T, R, AdditionalOptions> {
|
|
116
|
+
constructor(args?: ArgumentNames<AsArray<T>>, name?: string);
|
|
117
|
+
callAsyncStageRange(queried: QueriedHook<T, R, AdditionalOptions>, ...args: Append<AsArray<T>, Callback<Error, R>>): void;
|
|
118
|
+
tapAsync(options: Options<AdditionalOptions>, fn: FnWithCallback<T, void>): void;
|
|
119
|
+
tapPromise(options: Options<AdditionalOptions>, fn: Fn<T, void>): void;
|
|
120
|
+
}
|
|
115
121
|
export type HookMapKey = any;
|
|
116
122
|
export type HookFactory<H> = (key: HookMapKey, hook?: H) => H;
|
|
117
123
|
export interface HookMapInterceptor<H> {
|