@rspack/core 1.1.1 → 1.1.2
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 -2
- package/dist/Compilation.d.ts +16 -3
- package/dist/Dependency.d.ts +2 -2
- package/dist/builtin-loader/lightningcss/index.d.ts +5 -0
- package/dist/builtin-plugin/LightningCssMinimizerRspackPlugin.d.ts +5 -0
- package/dist/config/normalization.d.ts +2 -1
- package/dist/config/types.d.ts +48 -7
- package/dist/config/zod.d.ts +187 -56
- package/dist/index.js +276 -224
- package/package.json +2 -2
package/dist/Chunk.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type JsChunk, type
|
|
1
|
+
import { type JsChunk, type JsCompilation } from "@rspack/binding";
|
|
2
2
|
import { Compilation } from ".";
|
|
3
3
|
import { ChunkGroup } from "./ChunkGroup";
|
|
4
4
|
export declare class Chunk {
|
|
@@ -37,5 +37,4 @@ export declare class Chunk {
|
|
|
37
37
|
* @internal
|
|
38
38
|
*/
|
|
39
39
|
__internal__innerUkey(): number;
|
|
40
|
-
__internal_to_path_data_chunk(): JsChunkPathData;
|
|
41
40
|
}
|
package/dist/Compilation.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
10
|
import type * as binding from "@rspack/binding";
|
|
11
|
-
import { type ExternalObject, type JsCompilation, type
|
|
11
|
+
import { type ExternalObject, type JsCompilation, type JsRuntimeModule } from "@rspack/binding";
|
|
12
12
|
import * as liteTapable from "@rspack/lite-tapable";
|
|
13
13
|
import type { Source } from "../compiled/webpack-sources";
|
|
14
14
|
import { Chunk } from "./Chunk";
|
|
@@ -37,8 +37,21 @@ export interface Asset {
|
|
|
37
37
|
source: Source;
|
|
38
38
|
info: AssetInfo;
|
|
39
39
|
}
|
|
40
|
-
export type
|
|
41
|
-
|
|
40
|
+
export type PathDataChunkLike = {
|
|
41
|
+
id?: string;
|
|
42
|
+
name?: string;
|
|
43
|
+
hash?: string;
|
|
44
|
+
contentHash?: Record<string, string>;
|
|
45
|
+
};
|
|
46
|
+
export type PathData = {
|
|
47
|
+
filename?: string;
|
|
48
|
+
hash?: string;
|
|
49
|
+
contentHash?: string;
|
|
50
|
+
runtime?: string;
|
|
51
|
+
url?: string;
|
|
52
|
+
id?: string;
|
|
53
|
+
chunk?: Chunk | PathDataChunkLike;
|
|
54
|
+
contentHashType?: string;
|
|
42
55
|
};
|
|
43
56
|
export interface LogEntry {
|
|
44
57
|
type: string;
|
package/dist/Dependency.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { JsDependency } from "@rspack/binding";
|
|
2
2
|
export declare class Dependency {
|
|
3
3
|
readonly type: string;
|
|
4
4
|
readonly category: string;
|
|
5
5
|
readonly request: string | undefined;
|
|
6
6
|
critical: boolean;
|
|
7
|
-
static __from_binding(binding:
|
|
7
|
+
static __from_binding(binding: JsDependency): Dependency;
|
|
8
8
|
private constructor();
|
|
9
9
|
}
|
|
@@ -83,7 +83,12 @@ export type LoaderOptions = {
|
|
|
83
83
|
targets?: Targets | string[] | string;
|
|
84
84
|
include?: FeatureOptions;
|
|
85
85
|
exclude?: FeatureOptions;
|
|
86
|
+
/**
|
|
87
|
+
* @deprecated Use `drafts` instead.
|
|
88
|
+
* This will be removed in the next major version.
|
|
89
|
+
*/
|
|
86
90
|
draft?: Drafts;
|
|
91
|
+
drafts?: Drafts;
|
|
87
92
|
nonStandard?: NonStandard;
|
|
88
93
|
pseudoClasses?: PseudoClasses;
|
|
89
94
|
unusedSymbols?: string[];
|
|
@@ -11,7 +11,12 @@ export type LightningCssMinimizerRspackPluginOptions = {
|
|
|
11
11
|
targets?: string[] | string;
|
|
12
12
|
include?: FeatureOptions;
|
|
13
13
|
exclude?: FeatureOptions;
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated Use `drafts` instead.
|
|
16
|
+
* This will be removed in the next major version.
|
|
17
|
+
*/
|
|
14
18
|
draft?: Drafts;
|
|
19
|
+
drafts?: Drafts;
|
|
15
20
|
nonStandard?: NonStandard;
|
|
16
21
|
pseudoClasses?: PseudoClasses;
|
|
17
22
|
unusedSymbols?: string[];
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* https://github.com/webpack/webpack/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
10
|
import type { Compilation } from "../Compilation";
|
|
11
|
-
import type { AssetModuleFilename, Bail, CacheOptions, ChunkFilename, ChunkLoading, ChunkLoadingGlobal, Clean, Context, CrossOriginLoading, CssChunkFilename, CssFilename, Dependencies, DevServer, DevTool, DevtoolFallbackModuleFilenameTemplate, DevtoolModuleFilenameTemplate, DevtoolNamespace, EnabledLibraryTypes, EnabledWasmLoadingTypes, EntryDescription, Environment, Externals, ExternalsPresets, ExternalsType, Filename, GeneratorOptionsByModuleType, GlobalObject, HashDigest, HashDigestLength, HashFunction, HashSalt, HotUpdateChunkFilename, HotUpdateGlobal, HotUpdateMainFilename, Iife, ImportFunctionName, ImportMetaName, Incremental, InfrastructureLogging, LazyCompilationOptions, LibraryOptions, Loader, Mode, Name, NoParseOption, Node, Optimization, OutputModule, ParserOptionsByModuleType, Path, Performance, Plugins, Profile, PublicPath, Resolve, RspackFutureOptions, RspackOptions, RuleSetRules, ScriptType, SnapshotOptions, SourceMapFilename, StatsValue, StrictModuleErrorHandling, Target, TrustedTypes, UniqueName, WasmLoading, Watch, WatchOptions, WebassemblyModuleFilename, WorkerPublicPath } from "./types";
|
|
11
|
+
import type { AssetModuleFilename, Bail, CacheOptions, ChunkFilename, ChunkLoading, ChunkLoadingGlobal, Clean, Context, CrossOriginLoading, CssChunkFilename, CssFilename, Dependencies, DevServer, DevTool, DevtoolFallbackModuleFilenameTemplate, DevtoolModuleFilenameTemplate, DevtoolNamespace, EnabledLibraryTypes, EnabledWasmLoadingTypes, EntryDescription, Environment, ExperimentCacheOptions, Externals, ExternalsPresets, ExternalsType, Filename, GeneratorOptionsByModuleType, GlobalObject, HashDigest, HashDigestLength, HashFunction, HashSalt, HotUpdateChunkFilename, HotUpdateGlobal, HotUpdateMainFilename, Iife, ImportFunctionName, ImportMetaName, Incremental, InfrastructureLogging, LazyCompilationOptions, LibraryOptions, Loader, Mode, Name, NoParseOption, Node, Optimization, OutputModule, ParserOptionsByModuleType, Path, Performance, Plugins, Profile, PublicPath, Resolve, RspackFutureOptions, RspackOptions, RuleSetRules, ScriptType, SnapshotOptions, SourceMapFilename, StatsValue, StrictModuleErrorHandling, Target, TrustedTypes, UniqueName, WasmLoading, Watch, WatchOptions, WebassemblyModuleFilename, WorkerPublicPath } from "./types";
|
|
12
12
|
export declare const getNormalizedRspackOptions: (config: RspackOptions) => RspackOptionsNormalized;
|
|
13
13
|
export type EntryDynamicNormalized = () => Promise<EntryStaticNormalized>;
|
|
14
14
|
export type EntryNormalized = EntryDynamicNormalized | EntryStaticNormalized;
|
|
@@ -77,6 +77,7 @@ export interface ModuleOptionsNormalized {
|
|
|
77
77
|
noParse?: NoParseOption;
|
|
78
78
|
}
|
|
79
79
|
export interface ExperimentsNormalized {
|
|
80
|
+
cache?: ExperimentCacheOptions;
|
|
80
81
|
lazyCompilation?: false | LazyCompilationOptions;
|
|
81
82
|
asyncWebAssembly?: boolean;
|
|
82
83
|
outputModule?: boolean;
|
package/dist/config/types.d.ts
CHANGED
|
@@ -887,7 +887,7 @@ export type Target = false | AllowTarget | AllowTarget[];
|
|
|
887
887
|
* `amd`, `umd`, `system` and `jsonp` externals depend on the `output.libraryTarget` being set to the same value e.g. you can only consume amd externals within an amd library.
|
|
888
888
|
* @default 'var'
|
|
889
889
|
*/
|
|
890
|
-
export type ExternalsType = "var" | "module" | "assign" | "this" | "window" | "self" | "global" | "commonjs" | "commonjs2" | "commonjs-module" | "commonjs-static" | "amd" | "amd-require" | "umd" | "umd2" | "jsonp" | "system" | "promise" | "import" | "module-import" | "script" | "node-commonjs";
|
|
890
|
+
export type ExternalsType = "var" | "module" | "assign" | "this" | "window" | "self" | "global" | "commonjs" | "commonjs2" | "commonjs-module" | "commonjs-static" | "amd" | "amd-require" | "umd" | "umd2" | "jsonp" | "system" | "promise" | "import" | "module-import" | "script" | "node-commonjs" | "commonjs-import";
|
|
891
891
|
/**
|
|
892
892
|
* External item object when both libraryTarget and externalsType is 'umd'
|
|
893
893
|
*/
|
|
@@ -1683,6 +1683,31 @@ export type Optimization = {
|
|
|
1683
1683
|
* */
|
|
1684
1684
|
emitOnErrors?: boolean;
|
|
1685
1685
|
};
|
|
1686
|
+
/**
|
|
1687
|
+
* Options for caching snapshots and intermediate products during the build process.
|
|
1688
|
+
* @description Controls whether caching is enabled or disabled.
|
|
1689
|
+
* @default true in development mode, false in production mode
|
|
1690
|
+
* @example
|
|
1691
|
+
* // Enable caching
|
|
1692
|
+
* cache: true
|
|
1693
|
+
*
|
|
1694
|
+
* // Disable caching
|
|
1695
|
+
* cache: false
|
|
1696
|
+
*/
|
|
1697
|
+
export type ExperimentCacheOptions = boolean | {
|
|
1698
|
+
type: "memory";
|
|
1699
|
+
} | {
|
|
1700
|
+
type: "persistent";
|
|
1701
|
+
snapshot: {
|
|
1702
|
+
immutablePaths: Array<string | RegExp>;
|
|
1703
|
+
unmanagedPaths: Array<string | RegExp>;
|
|
1704
|
+
managedPaths: Array<string | RegExp>;
|
|
1705
|
+
};
|
|
1706
|
+
storage: {
|
|
1707
|
+
type: "filesystem";
|
|
1708
|
+
directory: string;
|
|
1709
|
+
};
|
|
1710
|
+
};
|
|
1686
1711
|
/**
|
|
1687
1712
|
* Options for future Rspack features.
|
|
1688
1713
|
*/
|
|
@@ -1784,10 +1809,6 @@ export type Incremental = {
|
|
|
1784
1809
|
* Enable incremental make.
|
|
1785
1810
|
*/
|
|
1786
1811
|
make?: boolean;
|
|
1787
|
-
/**
|
|
1788
|
-
* Enable incremental asset emission.
|
|
1789
|
-
*/
|
|
1790
|
-
emitAssets?: boolean;
|
|
1791
1812
|
/**
|
|
1792
1813
|
* Enable inference of async modules.
|
|
1793
1814
|
*/
|
|
@@ -1800,6 +1821,10 @@ export type Incremental = {
|
|
|
1800
1821
|
* Enables diagnostics for dependencies.
|
|
1801
1822
|
*/
|
|
1802
1823
|
dependenciesDiagnostics?: boolean;
|
|
1824
|
+
/**
|
|
1825
|
+
* Enable incremental build chunk graph.
|
|
1826
|
+
*/
|
|
1827
|
+
buildChunkGraph?: boolean;
|
|
1803
1828
|
/**
|
|
1804
1829
|
* Enable incremental module hashes.
|
|
1805
1830
|
*/
|
|
@@ -1813,14 +1838,30 @@ export type Incremental = {
|
|
|
1813
1838
|
*/
|
|
1814
1839
|
modulesRuntimeRequirements?: boolean;
|
|
1815
1840
|
/**
|
|
1816
|
-
* Enable incremental
|
|
1841
|
+
* Enable incremental chunk runtime requirements.
|
|
1817
1842
|
*/
|
|
1818
|
-
|
|
1843
|
+
chunksRuntimeRequirements?: boolean;
|
|
1844
|
+
/**
|
|
1845
|
+
* Enable incremental chunk hashes.
|
|
1846
|
+
*/
|
|
1847
|
+
chunksHashes?: boolean;
|
|
1848
|
+
/**
|
|
1849
|
+
* Enable incremental chunk render.
|
|
1850
|
+
*/
|
|
1851
|
+
chunksRender?: boolean;
|
|
1852
|
+
/**
|
|
1853
|
+
* Enable incremental asset emission.
|
|
1854
|
+
*/
|
|
1855
|
+
emitAssets?: boolean;
|
|
1819
1856
|
};
|
|
1820
1857
|
/**
|
|
1821
1858
|
* Experimental features configuration.
|
|
1822
1859
|
*/
|
|
1823
1860
|
export type Experiments = {
|
|
1861
|
+
/**
|
|
1862
|
+
* Enable new cache.
|
|
1863
|
+
*/
|
|
1864
|
+
cache?: ExperimentCacheOptions;
|
|
1824
1865
|
/**
|
|
1825
1866
|
* Enable lazy compilation.
|
|
1826
1867
|
*/
|