@rspack/core 1.2.0-beta.0 → 1.2.1
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/compiled/browserslist/index.js +28 -28
- package/compiled/graceful-fs/index.js +18 -18
- package/compiled/watchpack/index.js +34 -34
- package/compiled/webpack-sources/index.js +76 -76
- package/compiled/zod/index.js +30 -30
- package/dist/ChunkGraph.d.ts +1 -0
- package/dist/ChunkGroup.d.ts +2 -0
- package/dist/Compiler.d.ts +30 -2
- package/dist/ResolverFactory.d.ts +1 -1
- 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 +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/ContextReplacementPlugin.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/DllEntryPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DllReferenceAgencyPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ElectronTargetPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EnableChunkLoadingPlugin.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/EvalDevToolModulePlugin.d.ts +1 -1
- package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FetchCompileAsyncWasmPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FileUriPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FlagAllModulesAsUsedPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FlagDependencyExportsPlugin.d.ts +1 -1
- 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/JsLoaderRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/JsonModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/LibManifestPlugin.d.ts +1 -1
- package/dist/builtin-plugin/LightningCssMinimizerRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/LimitChunkCountPlugin.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/NamedChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NamedModuleIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NoEmitOnErrorsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NodeTargetPlugin.d.ts +1 -1
- package/dist/builtin-plugin/OccurrenceChunkIdsPlugin.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/RemoveDuplicateModulesPlugin.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/SwcJsMinimizerPlugin.d.ts +1 -1
- package/dist/builtin-plugin/WarnCaseSensitiveModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/base.d.ts +1 -1
- package/dist/builtin-plugin/html-plugin/hooks.d.ts +30 -0
- package/dist/builtin-plugin/html-plugin/index.d.ts +2 -0
- package/dist/builtin-plugin/{HtmlRspackPlugin.d.ts → html-plugin/options.d.ts} +5 -47
- package/dist/builtin-plugin/html-plugin/plugin.d.ts +25 -0
- package/dist/builtin-plugin/html-plugin/taps.d.ts +2 -0
- package/dist/builtin-plugin/index.d.ts +1 -1
- package/dist/builtin-plugin/lazy-compilation/backend.d.ts +1 -1
- package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +1 -1
- package/dist/config/normalization.d.ts +3 -2
- package/dist/config/types.d.ts +32 -52
- package/dist/config/zod.d.ts +67 -62
- package/dist/container/ModuleFederationRuntimePlugin.d.ts +1 -1
- package/dist/exports.d.ts +2 -3
- package/dist/index.js +1941 -1670
- package/dist/stats/statsFactoryUtils.d.ts +9 -0
- package/dist/taps/compilation.d.ts +2 -0
- package/dist/taps/compiler.d.ts +2 -0
- package/dist/taps/contextModuleFactory.d.ts +2 -0
- package/dist/taps/index.d.ts +6 -0
- package/dist/taps/javascriptModules.d.ts +2 -0
- package/dist/taps/normalModuleFactory.d.ts +2 -0
- package/dist/taps/types.d.ts +11 -0
- package/package.json +9 -4
package/dist/config/types.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type * as webpackDevServer from "webpack-dev-server";
|
|
|
3
3
|
import type { Compilation, PathData } from "../Compilation";
|
|
4
4
|
import type { Compiler } from "../Compiler";
|
|
5
5
|
import type { Module } from "../Module";
|
|
6
|
+
import type { LazyCompilationDefaultBackendOptions } from "../builtin-plugin/lazy-compilation/backend";
|
|
6
7
|
import type { Chunk } from "../exports";
|
|
7
8
|
export type FilenameTemplate = string;
|
|
8
9
|
export type Filename = FilenameTemplate | ((pathData: PathData, assetInfo?: JsAssetInfo) => string);
|
|
@@ -574,6 +575,8 @@ export type ResolveOptions = {
|
|
|
574
575
|
roots?: string[];
|
|
575
576
|
/** Customize the Resolve configuration based on the module type. */
|
|
576
577
|
byDependency?: Record<string, ResolveOptions>;
|
|
578
|
+
/** enable Yarn PnP */
|
|
579
|
+
pnp?: boolean;
|
|
577
580
|
};
|
|
578
581
|
/** Used to configure the Rspack module resolution */
|
|
579
582
|
export type Resolve = ResolveOptions;
|
|
@@ -770,6 +773,10 @@ export type JsonParserOptions = {
|
|
|
770
773
|
* The depth of json dependency flagged as `exportInfo`.
|
|
771
774
|
*/
|
|
772
775
|
exportsDepth?: number;
|
|
776
|
+
/**
|
|
777
|
+
* If Rule.type is set to 'json' then Rules.parser.parse option may be a function that implements custom logic to parse module's source and convert it to a json-compatible data.
|
|
778
|
+
*/
|
|
779
|
+
parse?: (source: string) => any;
|
|
773
780
|
};
|
|
774
781
|
/** Configure all parsers' options in one place with module.parser. */
|
|
775
782
|
export type ParserOptionsByModuleTypeKnown = {
|
|
@@ -814,6 +821,13 @@ export type AssetInlineGeneratorOptions = {
|
|
|
814
821
|
};
|
|
815
822
|
/** Emit the asset in the specified folder relative to 'output.path'. */
|
|
816
823
|
export type AssetModuleOutputPath = Filename;
|
|
824
|
+
/**
|
|
825
|
+
* If "url", a URL pointing to the asset will be generated based on publicPath.
|
|
826
|
+
* If "preserve", preserve import/require statement from generated asset.
|
|
827
|
+
* Only for modules with module type 'asset' or 'asset/resource'.
|
|
828
|
+
* @default "url"
|
|
829
|
+
*/
|
|
830
|
+
export type AssetModuleImportMode = "url" | "preserve";
|
|
817
831
|
/** Options for asset modules. */
|
|
818
832
|
export type AssetResourceGeneratorOptions = {
|
|
819
833
|
/**
|
|
@@ -827,6 +841,13 @@ export type AssetResourceGeneratorOptions = {
|
|
|
827
841
|
outputPath?: AssetModuleOutputPath;
|
|
828
842
|
/** This option determines the URL prefix of the referenced 'asset' or 'asset/resource'*/
|
|
829
843
|
publicPath?: PublicPath;
|
|
844
|
+
/**
|
|
845
|
+
* If "url", a URL pointing to the asset will be generated based on publicPath.
|
|
846
|
+
* If "preserve", preserve import/require statement from generated asset.
|
|
847
|
+
* Only for modules with module type 'asset' or 'asset/resource'.
|
|
848
|
+
* @default "url"
|
|
849
|
+
*/
|
|
850
|
+
importMode?: AssetModuleImportMode;
|
|
830
851
|
};
|
|
831
852
|
/** Generator options for asset modules. */
|
|
832
853
|
export type AssetGeneratorOptions = AssetInlineGeneratorOptions & AssetResourceGeneratorOptions;
|
|
@@ -1497,7 +1518,7 @@ export type OptimizationRuntimeChunk = boolean | "single" | "multiple" | {
|
|
|
1497
1518
|
name: string;
|
|
1498
1519
|
}) => string);
|
|
1499
1520
|
};
|
|
1500
|
-
export type OptimizationSplitChunksNameFunction = (module
|
|
1521
|
+
export type OptimizationSplitChunksNameFunction = (module: Module, chunks: Chunk[], cacheGroupKey: string) => string | undefined;
|
|
1501
1522
|
type OptimizationSplitChunksName = string | false | OptimizationSplitChunksNameFunction;
|
|
1502
1523
|
type OptimizationSplitChunksSizes = number | Record<string, number>;
|
|
1503
1524
|
type OptimizationSplitChunksChunks = "initial" | "async" | "all" | RegExp | ((chunk: Chunk) => boolean);
|
|
@@ -1763,43 +1784,6 @@ export type RspackFutureOptions = {
|
|
|
1763
1784
|
force?: boolean | ("version" | "uniqueId")[];
|
|
1764
1785
|
};
|
|
1765
1786
|
};
|
|
1766
|
-
/**
|
|
1767
|
-
* Options for server listening.
|
|
1768
|
-
*/
|
|
1769
|
-
type ListenOptions = {
|
|
1770
|
-
/**
|
|
1771
|
-
* The port to listen on.
|
|
1772
|
-
*/
|
|
1773
|
-
port?: number;
|
|
1774
|
-
/**
|
|
1775
|
-
* The host to listen on.
|
|
1776
|
-
*/
|
|
1777
|
-
host?: string;
|
|
1778
|
-
/**
|
|
1779
|
-
* The backlog of connections.
|
|
1780
|
-
*/
|
|
1781
|
-
backlog?: number;
|
|
1782
|
-
/**
|
|
1783
|
-
* The path for Unix socket.
|
|
1784
|
-
*/
|
|
1785
|
-
path?: string;
|
|
1786
|
-
/**
|
|
1787
|
-
* Whether the server is exclusive.
|
|
1788
|
-
*/
|
|
1789
|
-
exclusive?: boolean;
|
|
1790
|
-
/**
|
|
1791
|
-
* Whether the socket is readable by all users.
|
|
1792
|
-
*/
|
|
1793
|
-
readableAll?: boolean;
|
|
1794
|
-
/**
|
|
1795
|
-
* Whether the socket is writable by all users.
|
|
1796
|
-
*/
|
|
1797
|
-
writableAll?: boolean;
|
|
1798
|
-
/**
|
|
1799
|
-
* Whether to use IPv6 only.
|
|
1800
|
-
*/
|
|
1801
|
-
ipv6Only?: boolean;
|
|
1802
|
-
};
|
|
1803
1787
|
/**
|
|
1804
1788
|
* Options for lazy compilation.
|
|
1805
1789
|
*/
|
|
@@ -1807,20 +1791,7 @@ export type LazyCompilationOptions = {
|
|
|
1807
1791
|
/**
|
|
1808
1792
|
* Backend configuration for lazy compilation.
|
|
1809
1793
|
*/
|
|
1810
|
-
backend?:
|
|
1811
|
-
/**
|
|
1812
|
-
* Client script path.
|
|
1813
|
-
*/
|
|
1814
|
-
client?: string;
|
|
1815
|
-
/**
|
|
1816
|
-
* Listening options.
|
|
1817
|
-
*/
|
|
1818
|
-
listen?: number | ListenOptions;
|
|
1819
|
-
/**
|
|
1820
|
-
* Protocol to use.
|
|
1821
|
-
*/
|
|
1822
|
-
protocol?: "http" | "https";
|
|
1823
|
-
};
|
|
1794
|
+
backend?: LazyCompilationDefaultBackendOptions;
|
|
1824
1795
|
/**
|
|
1825
1796
|
* Enable lazy compilation for imports.
|
|
1826
1797
|
*/
|
|
@@ -1909,19 +1880,23 @@ export type Experiments = {
|
|
|
1909
1880
|
cache?: ExperimentCacheOptions;
|
|
1910
1881
|
/**
|
|
1911
1882
|
* Enable lazy compilation.
|
|
1883
|
+
* @default false
|
|
1912
1884
|
*/
|
|
1913
1885
|
lazyCompilation?: boolean | LazyCompilationOptions;
|
|
1914
1886
|
/**
|
|
1915
1887
|
* Enable async WebAssembly.
|
|
1916
1888
|
* Support the new WebAssembly according to the [updated specification](https://github.com/WebAssembly/esm-integration), it makes a WebAssembly module an async module.
|
|
1889
|
+
* @default false
|
|
1917
1890
|
*/
|
|
1918
1891
|
asyncWebAssembly?: boolean;
|
|
1919
1892
|
/**
|
|
1920
1893
|
* Enable output as ES module.
|
|
1894
|
+
* @default false
|
|
1921
1895
|
*/
|
|
1922
1896
|
outputModule?: boolean;
|
|
1923
1897
|
/**
|
|
1924
1898
|
* Enable top-level await.
|
|
1899
|
+
* @default true
|
|
1925
1900
|
*/
|
|
1926
1901
|
topLevelAwait?: boolean;
|
|
1927
1902
|
/**
|
|
@@ -1946,8 +1921,13 @@ export type Experiments = {
|
|
|
1946
1921
|
* Enable incremental builds.
|
|
1947
1922
|
*/
|
|
1948
1923
|
incremental?: boolean | Incremental;
|
|
1924
|
+
/**
|
|
1925
|
+
* Enable multi-threaded code splitting algorithm.
|
|
1926
|
+
*/
|
|
1927
|
+
parallelCodeSplitting?: boolean;
|
|
1949
1928
|
/**
|
|
1950
1929
|
* Enable future default options.
|
|
1930
|
+
* @default false
|
|
1951
1931
|
*/
|
|
1952
1932
|
futureDefaults?: boolean;
|
|
1953
1933
|
/**
|