@rspack/core 1.0.0-beta.2 → 1.0.0-beta.4
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/Compilation.d.ts +21 -8
- package/dist/Compilation.js +114 -57
- package/dist/Compiler.d.ts +1 -0
- package/dist/Compiler.js +29 -24
- package/dist/DependenciesBlock.d.ts +8 -0
- package/dist/DependenciesBlock.js +30 -0
- package/dist/Dependency.d.ts +8 -0
- package/dist/Dependency.js +32 -0
- package/dist/Module.d.ts +6 -3
- package/dist/Module.js +13 -0
- package/dist/MultiCompiler.js +10 -6
- package/dist/MultiStats.d.ts +1 -1
- package/dist/MultiStats.js +19 -16
- package/dist/NormalModule.js +3 -4
- package/dist/Stats.d.ts +1 -1
- package/dist/Template.d.ts +4 -4
- package/dist/Template.js +6 -4
- package/dist/Watching.js +3 -5
- package/dist/builtin-plugin/DynamicEntryPlugin.d.ts +11 -10
- package/dist/builtin-plugin/DynamicEntryPlugin.js +26 -15
- package/dist/builtin-plugin/EntryPlugin.d.ts +2 -2
- package/dist/builtin-plugin/ExternalsPlugin.d.ts +4 -4
- package/dist/builtin-plugin/LightningCssMiminizerRspackPlugin.d.ts +21 -4
- package/dist/builtin-plugin/LightningCssMiminizerRspackPlugin.js +29 -5
- package/dist/builtin-plugin/SwcCssMinimizerPlugin.d.ts +4 -6
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +16 -10
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.js +11 -9
- package/dist/builtin-plugin/css-extract/hmr/hotModuleReplacement.js +28 -17
- package/dist/builtin-plugin/css-extract/hmr/normalizeUrl.d.ts +1 -1
- package/dist/builtin-plugin/css-extract/hmr/normalizeUrl.js +2 -2
- package/dist/builtin-plugin/css-extract/loader.js +1 -2
- package/dist/config/adapter.d.ts +2 -2
- package/dist/config/defaults.js +9 -6
- package/dist/config/zod.d.ts +537 -141
- package/dist/config/zod.js +18 -10
- package/dist/container/ContainerReferencePlugin.d.ts +1 -1
- package/dist/exports.d.ts +4 -3
- package/dist/exports.js +5 -2
- package/dist/lib/Cache.js +6 -4
- package/dist/lib/CacheFacade.js +8 -9
- package/dist/lib/LoaderOptionsPlugin.d.ts +4 -2
- package/dist/lib/LoaderOptionsPlugin.js +0 -2
- package/dist/lib/cache/mergeEtags.d.ts +3 -3
- package/dist/lib/cache/mergeEtags.js +5 -3
- package/dist/loader-runner/index.js +4 -2
- package/dist/node/nodeConsole.js +5 -5
- package/dist/stats/DefaultStatsFactoryPlugin.d.ts +0 -10
- package/dist/stats/DefaultStatsFactoryPlugin.js +130 -90
- package/dist/stats/DefaultStatsPresetPlugin.js +17 -18
- package/dist/stats/StatsFactory.js +8 -10
- package/dist/stats/StatsPrinter.js +3 -4
- package/dist/stats/statsFactoryUtils.d.ts +119 -19
- package/dist/stats/statsFactoryUtils.js +62 -1
- package/dist/util/assertNotNil.d.ts +1 -1
- package/dist/util/assetCondition.d.ts +2 -0
- package/dist/util/assetCondition.js +2 -0
- package/dist/util/cleverMerge.js +5 -4
- package/dist/util/createHash.js +10 -5
- package/dist/util/hash/wasm-hash.js +5 -4
- package/dist/util/identifier.d.ts +4 -4
- package/dist/util/identifier.js +10 -10
- package/dist/util/memoize.js +3 -2
- package/package.json +3 -3
- package/dist/builtin-plugin/css-extract/loader-options.json +0 -37
- package/dist/builtin-plugin/css-extract/plugin-options.json +0 -79
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare function normalizeUrl(
|
|
1
|
+
declare function normalizeUrl(url: string): string;
|
|
2
2
|
export { normalizeUrl };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.normalizeUrl = void 0;
|
|
4
|
-
function normalizeUrl(
|
|
5
|
-
urlString =
|
|
4
|
+
function normalizeUrl(url) {
|
|
5
|
+
const urlString = url.trim();
|
|
6
6
|
if (/^data:/i.test(urlString)) {
|
|
7
7
|
return urlString;
|
|
8
8
|
}
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.pitch = exports.hotLoader = exports.SINGLE_DOT_PATH_SEGMENT = exports.ABSOLUTE_PUBLIC_PATH = exports.AUTO_PUBLIC_PATH = exports.MODULE_TYPE = exports.BASE_URI = void 0;
|
|
7
7
|
const node_path_1 = __importDefault(require("node:path"));
|
|
8
8
|
const index_1 = require("./index");
|
|
9
|
-
const loader_options_json_1 = __importDefault(require("./loader-options.json"));
|
|
10
9
|
const utils_1 = require("./utils");
|
|
11
10
|
exports.BASE_URI = "webpack://";
|
|
12
11
|
exports.MODULE_TYPE = "css/mini-extract";
|
|
@@ -63,7 +62,7 @@ const pitch = function (request, _, data) {
|
|
|
63
62
|
this.emitWarning(e);
|
|
64
63
|
return;
|
|
65
64
|
}
|
|
66
|
-
const options = this.getOptions(
|
|
65
|
+
const options = this.getOptions();
|
|
67
66
|
const emit = typeof options.emit !== "undefined" ? options.emit : true;
|
|
68
67
|
const callback = this.async();
|
|
69
68
|
const filepath = this.resourcePath;
|
package/dist/config/adapter.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type JsLibraryOptions, type RawOptions } from "@rspack/binding";
|
|
2
2
|
import type { Compiler } from "../Compiler";
|
|
3
3
|
import { type LoaderContext, type LoaderDefinition, type LoaderDefinitionFunction } from "./adapterRuleUse";
|
|
4
4
|
import type { RspackOptionsNormalized } from "./normalization";
|
|
@@ -6,5 +6,5 @@ import type { ChunkLoading, LibraryOptions, Resolve } from "./zod";
|
|
|
6
6
|
export type { LoaderContext, LoaderDefinition, LoaderDefinitionFunction };
|
|
7
7
|
export declare const getRawOptions: (options: RspackOptionsNormalized, compiler: Compiler) => RawOptions;
|
|
8
8
|
export declare function getRawResolve(resolve: Resolve): RawOptions["resolve"];
|
|
9
|
-
export declare function getRawLibrary(library: LibraryOptions):
|
|
9
|
+
export declare function getRawLibrary(library: LibraryOptions): JsLibraryOptions;
|
|
10
10
|
export declare function getRawChunkLoading(chunkLoading: ChunkLoading): string;
|
package/dist/config/defaults.js
CHANGED
|
@@ -77,10 +77,13 @@ const applyRspackOptionsDefaults = (options) => {
|
|
|
77
77
|
return options.output.library
|
|
78
78
|
? options.output.library.type
|
|
79
79
|
: options.output.module
|
|
80
|
-
? "module"
|
|
80
|
+
? "module-import"
|
|
81
81
|
: "var";
|
|
82
82
|
});
|
|
83
|
-
applyNodeDefaults(options.node, {
|
|
83
|
+
applyNodeDefaults(options.node, {
|
|
84
|
+
targetProperties,
|
|
85
|
+
outputModule: options.output.module
|
|
86
|
+
});
|
|
84
87
|
applyLoaderDefaults(options.loader, {
|
|
85
88
|
targetProperties,
|
|
86
89
|
environment: options.output.environment
|
|
@@ -633,7 +636,7 @@ const applyLoaderDefaults = (loader, { targetProperties, environment }) => {
|
|
|
633
636
|
});
|
|
634
637
|
D(loader, "environment", environment);
|
|
635
638
|
};
|
|
636
|
-
const applyNodeDefaults = (node, { targetProperties }) => {
|
|
639
|
+
const applyNodeDefaults = (node, { outputModule, targetProperties }) => {
|
|
637
640
|
if (node === false)
|
|
638
641
|
return;
|
|
639
642
|
// IGNORE(node.global): The default value of `global` is determined by `futureDefaults` in webpack.
|
|
@@ -645,13 +648,13 @@ const applyNodeDefaults = (node, { targetProperties }) => {
|
|
|
645
648
|
// IGNORE(node.__dirname): The default value of `__dirname` is determined by `futureDefaults` in webpack.
|
|
646
649
|
F(node, "__dirname", () => {
|
|
647
650
|
if (targetProperties?.node)
|
|
648
|
-
return "eval-only";
|
|
651
|
+
return outputModule ? "node-module" : "eval-only";
|
|
649
652
|
return "warn-mock";
|
|
650
653
|
});
|
|
651
654
|
// IGNORE(node.__filename): The default value of `__filename` is determined by `futureDefaults` in webpack.
|
|
652
655
|
F(node, "__filename", () => {
|
|
653
656
|
if (targetProperties?.node)
|
|
654
|
-
return "eval-only";
|
|
657
|
+
return outputModule ? "node-module" : "eval-only";
|
|
655
658
|
return "warn-mock";
|
|
656
659
|
});
|
|
657
660
|
};
|
|
@@ -707,7 +710,7 @@ const applyOptimizationDefaults = (optimization, { production, development, css
|
|
|
707
710
|
A(splitChunks, "defaultSizeTypes", () => css ? ["javascript", "css", "unknown"] : ["javascript", "unknown"]);
|
|
708
711
|
D(splitChunks, "hidePathInfo", production);
|
|
709
712
|
D(splitChunks, "chunks", "async");
|
|
710
|
-
|
|
713
|
+
D(splitChunks, "usedExports", optimization.usedExports === true);
|
|
711
714
|
D(splitChunks, "minChunks", 1);
|
|
712
715
|
F(splitChunks, "minSize", () => (production ? 20000 : 10000));
|
|
713
716
|
// F(splitChunks, "minRemainingSize", () => (development ? 0 : undefined));
|