@rspack/core 1.0.14 → 1.1.0-beta.0
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/@swc/types/index.d.ts +1962 -0
- package/compiled/@swc/types/index.js +19 -0
- package/compiled/@swc/types/license +201 -0
- package/compiled/@swc/types/package.json +1 -0
- package/dist/Compilation.d.ts +6 -17
- package/dist/FileSystem.d.ts +7 -2
- package/dist/Module.d.ts +5 -3
- package/dist/builtin-loader/swc/types.d.ts +9 -435
- package/dist/builtin-plugin/HtmlRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RemoveDuplicateModulesPlugin.d.ts +10 -0
- package/dist/builtin-plugin/SizeLimitsPlugin.d.ts +8 -8
- package/dist/builtin-plugin/SplitChunksPlugin.d.ts +1 -1
- package/dist/builtin-plugin/index.d.ts +4 -2
- package/dist/config/adapter.d.ts +1 -1
- package/dist/config/adapterRuleUse.d.ts +1 -1
- package/dist/config/index.d.ts +1 -0
- package/dist/config/normalization.d.ts +2 -1
- package/dist/config/types.d.ts +389 -3
- package/dist/config/zod.d.ts +894 -1303
- package/dist/exports.d.ts +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +410 -4840
- package/dist/util/ArrayQueue.d.ts +1 -9
- package/dist/util/asyncLib.d.ts +54 -0
- package/package.json +5 -5
- package/dist/builtin-loader/swc/react.d.ts +0 -15
- /package/dist/builtin-plugin/{LightningCssMiminizerRspackPlugin.d.ts → LightningCssMinimizerRspackPlugin.d.ts} +0 -0
package/dist/config/types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { JsAssetInfo, RawFuncUseCtx } from "@rspack/binding";
|
|
2
|
-
import type
|
|
2
|
+
import type * as webpackDevServer from "webpack-dev-server";
|
|
3
|
+
import type { Compilation, PathData } from "../Compilation";
|
|
3
4
|
import type { Compiler } from "../Compiler";
|
|
4
5
|
import type { Module } from "../Module";
|
|
5
6
|
import type { Chunk } from "../exports";
|
|
@@ -385,12 +386,12 @@ export type Output = {
|
|
|
385
386
|
hashDigest?: HashDigest;
|
|
386
387
|
/**
|
|
387
388
|
* The prefix length of the hash digest to use.
|
|
388
|
-
* @default
|
|
389
|
+
* @default 16
|
|
389
390
|
* */
|
|
390
391
|
hashDigestLength?: HashDigestLength;
|
|
391
392
|
/**
|
|
392
393
|
* The hashing algorithm to use.
|
|
393
|
-
* @default '
|
|
394
|
+
* @default 'xxhash64'
|
|
394
395
|
* */
|
|
395
396
|
hashFunction?: HashFunction;
|
|
396
397
|
/** An optional salt to update the hash. */
|
|
@@ -435,6 +436,10 @@ export type Output = {
|
|
|
435
436
|
charset?: boolean;
|
|
436
437
|
/** Tell Rspack what kind of ES-features may be used in the generated runtime-code. */
|
|
437
438
|
environment?: Environment;
|
|
439
|
+
/**
|
|
440
|
+
* Check if to be emitted file already exists and have the same content before writing to output filesystem.
|
|
441
|
+
*/
|
|
442
|
+
compareBeforeEmit?: boolean;
|
|
438
443
|
};
|
|
439
444
|
/**
|
|
440
445
|
* Path alias
|
|
@@ -712,6 +717,10 @@ export type JavascriptParserOptions = {
|
|
|
712
717
|
* @default false
|
|
713
718
|
* */
|
|
714
719
|
wrappedContextCritical?: boolean;
|
|
720
|
+
/**
|
|
721
|
+
* Set the inner regular expression for partial dynamic dependencies
|
|
722
|
+
* */
|
|
723
|
+
wrappedContextRegExp?: RegExp;
|
|
715
724
|
/**
|
|
716
725
|
* Warn or error for using non-existent exports and conflicting re-exports.
|
|
717
726
|
* @default 'auto'
|
|
@@ -1643,4 +1652,381 @@ export type Optimization = {
|
|
|
1643
1652
|
* */
|
|
1644
1653
|
emitOnErrors?: boolean;
|
|
1645
1654
|
};
|
|
1655
|
+
/**
|
|
1656
|
+
* Options for future Rspack features.
|
|
1657
|
+
*/
|
|
1658
|
+
export type RspackFutureOptions = {
|
|
1659
|
+
/**
|
|
1660
|
+
* Information about the bundler.
|
|
1661
|
+
*/
|
|
1662
|
+
bundlerInfo?: {
|
|
1663
|
+
/**
|
|
1664
|
+
* Version of the bundler.
|
|
1665
|
+
*/
|
|
1666
|
+
version?: string;
|
|
1667
|
+
/**
|
|
1668
|
+
* Name of the bundler.
|
|
1669
|
+
*/
|
|
1670
|
+
bundler?: string;
|
|
1671
|
+
/**
|
|
1672
|
+
* Force specific features.
|
|
1673
|
+
*/
|
|
1674
|
+
force?: boolean | ("version" | "uniqueId")[];
|
|
1675
|
+
};
|
|
1676
|
+
};
|
|
1677
|
+
/**
|
|
1678
|
+
* Options for server listening.
|
|
1679
|
+
*/
|
|
1680
|
+
type ListenOptions = {
|
|
1681
|
+
/**
|
|
1682
|
+
* The port to listen on.
|
|
1683
|
+
*/
|
|
1684
|
+
port?: number;
|
|
1685
|
+
/**
|
|
1686
|
+
* The host to listen on.
|
|
1687
|
+
*/
|
|
1688
|
+
host?: string;
|
|
1689
|
+
/**
|
|
1690
|
+
* The backlog of connections.
|
|
1691
|
+
*/
|
|
1692
|
+
backlog?: number;
|
|
1693
|
+
/**
|
|
1694
|
+
* The path for Unix socket.
|
|
1695
|
+
*/
|
|
1696
|
+
path?: string;
|
|
1697
|
+
/**
|
|
1698
|
+
* Whether the server is exclusive.
|
|
1699
|
+
*/
|
|
1700
|
+
exclusive?: boolean;
|
|
1701
|
+
/**
|
|
1702
|
+
* Whether the socket is readable by all users.
|
|
1703
|
+
*/
|
|
1704
|
+
readableAll?: boolean;
|
|
1705
|
+
/**
|
|
1706
|
+
* Whether the socket is writable by all users.
|
|
1707
|
+
*/
|
|
1708
|
+
writableAll?: boolean;
|
|
1709
|
+
/**
|
|
1710
|
+
* Whether to use IPv6 only.
|
|
1711
|
+
*/
|
|
1712
|
+
ipv6Only?: boolean;
|
|
1713
|
+
};
|
|
1714
|
+
/**
|
|
1715
|
+
* Options for lazy compilation.
|
|
1716
|
+
*/
|
|
1717
|
+
export type LazyCompilationOptions = {
|
|
1718
|
+
/**
|
|
1719
|
+
* Backend configuration for lazy compilation.
|
|
1720
|
+
*/
|
|
1721
|
+
backend?: {
|
|
1722
|
+
/**
|
|
1723
|
+
* Client script path.
|
|
1724
|
+
*/
|
|
1725
|
+
client?: string;
|
|
1726
|
+
/**
|
|
1727
|
+
* Listening options.
|
|
1728
|
+
*/
|
|
1729
|
+
listen?: number | ListenOptions;
|
|
1730
|
+
/**
|
|
1731
|
+
* Protocol to use.
|
|
1732
|
+
*/
|
|
1733
|
+
protocol?: "http" | "https";
|
|
1734
|
+
};
|
|
1735
|
+
/**
|
|
1736
|
+
* Enable lazy compilation for imports.
|
|
1737
|
+
*/
|
|
1738
|
+
imports?: boolean;
|
|
1739
|
+
/**
|
|
1740
|
+
* Enable lazy compilation for entries.
|
|
1741
|
+
*/
|
|
1742
|
+
entries?: boolean;
|
|
1743
|
+
/**
|
|
1744
|
+
* Test function or regex to determine which modules to include.
|
|
1745
|
+
*/
|
|
1746
|
+
test?: RegExp | ((module: any) => boolean);
|
|
1747
|
+
};
|
|
1748
|
+
/**
|
|
1749
|
+
* Options for incremental builds.
|
|
1750
|
+
*/
|
|
1751
|
+
export type Incremental = {
|
|
1752
|
+
/**
|
|
1753
|
+
* Enable incremental make.
|
|
1754
|
+
*/
|
|
1755
|
+
make?: boolean;
|
|
1756
|
+
/**
|
|
1757
|
+
* Enable incremental asset emission.
|
|
1758
|
+
*/
|
|
1759
|
+
emitAssets?: boolean;
|
|
1760
|
+
/**
|
|
1761
|
+
* Enable inference of async modules.
|
|
1762
|
+
*/
|
|
1763
|
+
inferAsyncModules?: boolean;
|
|
1764
|
+
/**
|
|
1765
|
+
* Enable incremental provided exports.
|
|
1766
|
+
*/
|
|
1767
|
+
providedExports?: boolean;
|
|
1768
|
+
/**
|
|
1769
|
+
* Enables diagnostics for dependencies.
|
|
1770
|
+
*/
|
|
1771
|
+
dependenciesDiagnostics?: boolean;
|
|
1772
|
+
/**
|
|
1773
|
+
* Enable incremental module hashes.
|
|
1774
|
+
*/
|
|
1775
|
+
modulesHashes?: boolean;
|
|
1776
|
+
/**
|
|
1777
|
+
* Enable incremental module code generation.
|
|
1778
|
+
*/
|
|
1779
|
+
modulesCodegen?: boolean;
|
|
1780
|
+
/**
|
|
1781
|
+
* Enable incremental module runtime requirements.
|
|
1782
|
+
*/
|
|
1783
|
+
modulesRuntimeRequirements?: boolean;
|
|
1784
|
+
/**
|
|
1785
|
+
* Enable incremental build chunk graph.
|
|
1786
|
+
*/
|
|
1787
|
+
buildChunkGraph?: boolean;
|
|
1788
|
+
};
|
|
1789
|
+
/**
|
|
1790
|
+
* Experimental features configuration.
|
|
1791
|
+
*/
|
|
1792
|
+
export type Experiments = {
|
|
1793
|
+
/**
|
|
1794
|
+
* Enable lazy compilation.
|
|
1795
|
+
*/
|
|
1796
|
+
lazyCompilation?: boolean | LazyCompilationOptions;
|
|
1797
|
+
/**
|
|
1798
|
+
* Enable async WebAssembly.
|
|
1799
|
+
* Support the new WebAssembly according to the [updated specification](https://github.com/WebAssembly/esm-integration), it makes a WebAssembly module an async module.
|
|
1800
|
+
*/
|
|
1801
|
+
asyncWebAssembly?: boolean;
|
|
1802
|
+
/**
|
|
1803
|
+
* Enable output as ES module.
|
|
1804
|
+
*/
|
|
1805
|
+
outputModule?: boolean;
|
|
1806
|
+
/**
|
|
1807
|
+
* Enable top-level await.
|
|
1808
|
+
*/
|
|
1809
|
+
topLevelAwait?: boolean;
|
|
1810
|
+
/**
|
|
1811
|
+
* Enable CSS support.
|
|
1812
|
+
*
|
|
1813
|
+
* @description
|
|
1814
|
+
* Once enabled, Rspack will enable native CSS support, and CSS related parser and generator options.
|
|
1815
|
+
* - `module.parser["css/auto"]`
|
|
1816
|
+
* - `module.parser.css`
|
|
1817
|
+
* - `module.parser["css/module"]`
|
|
1818
|
+
* - `module.generator["css/auto"]`
|
|
1819
|
+
* - `module.generator.css`
|
|
1820
|
+
* - `module.generator["css/module"]`
|
|
1821
|
+
*/
|
|
1822
|
+
css?: boolean;
|
|
1823
|
+
/**
|
|
1824
|
+
* Enable module layers feature.
|
|
1825
|
+
* @default false
|
|
1826
|
+
*/
|
|
1827
|
+
layers?: boolean;
|
|
1828
|
+
/**
|
|
1829
|
+
* Enable incremental builds.
|
|
1830
|
+
*/
|
|
1831
|
+
incremental?: boolean | Incremental;
|
|
1832
|
+
/**
|
|
1833
|
+
* Enable future default options.
|
|
1834
|
+
*/
|
|
1835
|
+
futureDefaults?: boolean;
|
|
1836
|
+
/**
|
|
1837
|
+
* Enable future Rspack features default options.
|
|
1838
|
+
*/
|
|
1839
|
+
rspackFuture?: RspackFutureOptions;
|
|
1840
|
+
};
|
|
1841
|
+
export type Watch = boolean;
|
|
1842
|
+
/** Options for watch mode. */
|
|
1843
|
+
export type WatchOptions = {
|
|
1844
|
+
/**
|
|
1845
|
+
* Add a delay before rebuilding once the first file changed.
|
|
1846
|
+
* This allows webpack to aggregate any other changes made during this time period into one rebuild.
|
|
1847
|
+
* @default 5
|
|
1848
|
+
*/
|
|
1849
|
+
aggregateTimeout?: number;
|
|
1850
|
+
/**
|
|
1851
|
+
* Follow symlinks while looking for files.
|
|
1852
|
+
* This is usually not needed as webpack already resolves symlinks ('resolve.symlinks' and 'resolve.alias').
|
|
1853
|
+
*/
|
|
1854
|
+
followSymlinks?: boolean;
|
|
1855
|
+
/**
|
|
1856
|
+
* Ignore some files from being watched.
|
|
1857
|
+
*/
|
|
1858
|
+
ignored?: string | RegExp | string[];
|
|
1859
|
+
/**
|
|
1860
|
+
* Turn on polling by passing true, or specifying a poll interval in milliseconds.
|
|
1861
|
+
* @default false
|
|
1862
|
+
*/
|
|
1863
|
+
poll?: number | boolean;
|
|
1864
|
+
/**
|
|
1865
|
+
* Stop watching when stdin stream has ended.
|
|
1866
|
+
*/
|
|
1867
|
+
stdin?: boolean;
|
|
1868
|
+
};
|
|
1869
|
+
/**
|
|
1870
|
+
* Options for devServer, it based on `webpack-dev-server@5`
|
|
1871
|
+
* */
|
|
1872
|
+
export interface DevServer extends webpackDevServer.Configuration {
|
|
1873
|
+
}
|
|
1874
|
+
/**
|
|
1875
|
+
* An array of either regular expressions or functions that determine if a warning should be ignored.
|
|
1876
|
+
*/
|
|
1877
|
+
export type IgnoreWarnings = (RegExp | ((error: Error, compilation: Compilation) => boolean))[];
|
|
1878
|
+
/**
|
|
1879
|
+
* Capture a "profile" of the application, including statistics and hints, which can then be dissected using the Analyze tool.
|
|
1880
|
+
* */
|
|
1881
|
+
export type Profile = boolean;
|
|
1882
|
+
/**
|
|
1883
|
+
* Fail out on the first error instead of tolerating it.
|
|
1884
|
+
* @default false
|
|
1885
|
+
* */
|
|
1886
|
+
export type Bail = boolean;
|
|
1887
|
+
/** Options to control how Rspack notifies you of assets and entry points that exceed a specific file limit. */
|
|
1888
|
+
export type Performance = false | {
|
|
1889
|
+
/**
|
|
1890
|
+
* Filter function to select assets that are checked.
|
|
1891
|
+
*/
|
|
1892
|
+
assetFilter?: (assetFilename: string) => boolean;
|
|
1893
|
+
/**
|
|
1894
|
+
* Sets the format of the hints: warnings, errors or nothing at all.
|
|
1895
|
+
*/
|
|
1896
|
+
hints?: false | "warning" | "error";
|
|
1897
|
+
/**
|
|
1898
|
+
* File size limit (in bytes) when exceeded, that webpack will provide performance hints.
|
|
1899
|
+
* @default 250000
|
|
1900
|
+
*/
|
|
1901
|
+
maxAssetSize?: number;
|
|
1902
|
+
/**
|
|
1903
|
+
* Total size of an entry point (in bytes).
|
|
1904
|
+
* @default 250000
|
|
1905
|
+
*/
|
|
1906
|
+
maxEntrypointSize?: number;
|
|
1907
|
+
};
|
|
1908
|
+
export type RspackOptions = {
|
|
1909
|
+
/**
|
|
1910
|
+
* The name of the Rspack configuration.
|
|
1911
|
+
*/
|
|
1912
|
+
name?: Name;
|
|
1913
|
+
/**
|
|
1914
|
+
* An array of dependencies required by the project.
|
|
1915
|
+
*/
|
|
1916
|
+
dependencies?: Dependencies;
|
|
1917
|
+
/**
|
|
1918
|
+
* The entry point of the application.
|
|
1919
|
+
*/
|
|
1920
|
+
entry?: Entry;
|
|
1921
|
+
/**
|
|
1922
|
+
* Configuration for the output of the compilation.
|
|
1923
|
+
*/
|
|
1924
|
+
output?: Output;
|
|
1925
|
+
/**
|
|
1926
|
+
* The environment in which the code should run.
|
|
1927
|
+
*/
|
|
1928
|
+
target?: Target;
|
|
1929
|
+
/**
|
|
1930
|
+
* The mode in which Rspack should operate.
|
|
1931
|
+
*/
|
|
1932
|
+
mode?: Mode;
|
|
1933
|
+
/**
|
|
1934
|
+
* Options for experimental features.
|
|
1935
|
+
*/
|
|
1936
|
+
experiments?: Experiments;
|
|
1937
|
+
/**
|
|
1938
|
+
* External libraries that should not be bundled.
|
|
1939
|
+
*/
|
|
1940
|
+
externals?: Externals;
|
|
1941
|
+
/**
|
|
1942
|
+
* The type of externals.
|
|
1943
|
+
*/
|
|
1944
|
+
externalsType?: ExternalsType;
|
|
1945
|
+
/**
|
|
1946
|
+
* Presets for external libraries.
|
|
1947
|
+
*/
|
|
1948
|
+
externalsPresets?: ExternalsPresets;
|
|
1949
|
+
/**
|
|
1950
|
+
* Logging options for infrastructure.
|
|
1951
|
+
*/
|
|
1952
|
+
infrastructureLogging?: InfrastructureLogging;
|
|
1953
|
+
/**
|
|
1954
|
+
* Options for caching.
|
|
1955
|
+
*/
|
|
1956
|
+
cache?: CacheOptions;
|
|
1957
|
+
/**
|
|
1958
|
+
* The context in which the compilation should occur.
|
|
1959
|
+
*/
|
|
1960
|
+
context?: Context;
|
|
1961
|
+
/**
|
|
1962
|
+
* The source map configuration.
|
|
1963
|
+
*/
|
|
1964
|
+
devtool?: DevTool;
|
|
1965
|
+
/**
|
|
1966
|
+
* Options for Node.js environment.
|
|
1967
|
+
*/
|
|
1968
|
+
node?: Node;
|
|
1969
|
+
/**
|
|
1970
|
+
* Configuration for loaders.
|
|
1971
|
+
*/
|
|
1972
|
+
loader?: Loader;
|
|
1973
|
+
/**
|
|
1974
|
+
* Warnings to ignore during compilation.
|
|
1975
|
+
*/
|
|
1976
|
+
ignoreWarnings?: IgnoreWarnings;
|
|
1977
|
+
/**
|
|
1978
|
+
* Options for watch mode.
|
|
1979
|
+
*/
|
|
1980
|
+
watchOptions?: WatchOptions;
|
|
1981
|
+
/**
|
|
1982
|
+
* Whether to enable watch mode.
|
|
1983
|
+
*/
|
|
1984
|
+
watch?: Watch;
|
|
1985
|
+
/**
|
|
1986
|
+
* Options for the stats output.
|
|
1987
|
+
*/
|
|
1988
|
+
stats?: StatsValue;
|
|
1989
|
+
/**
|
|
1990
|
+
* Options for snapshotting.
|
|
1991
|
+
*/
|
|
1992
|
+
snapshot?: SnapshotOptions;
|
|
1993
|
+
/**
|
|
1994
|
+
* Optimization options.
|
|
1995
|
+
*/
|
|
1996
|
+
optimization?: Optimization;
|
|
1997
|
+
/**
|
|
1998
|
+
* Options for resolving modules.
|
|
1999
|
+
*/
|
|
2000
|
+
resolve?: ResolveOptions;
|
|
2001
|
+
/**
|
|
2002
|
+
* Options for resolving loader modules.
|
|
2003
|
+
*/
|
|
2004
|
+
resolveLoader?: ResolveOptions;
|
|
2005
|
+
/**
|
|
2006
|
+
* Plugins to use during compilation.
|
|
2007
|
+
*/
|
|
2008
|
+
plugins?: Plugins;
|
|
2009
|
+
/**
|
|
2010
|
+
* Configuration for the development server.
|
|
2011
|
+
*/
|
|
2012
|
+
devServer?: DevServer;
|
|
2013
|
+
/**
|
|
2014
|
+
* Options for module configuration.
|
|
2015
|
+
*/
|
|
2016
|
+
module?: ModuleOptions;
|
|
2017
|
+
/**
|
|
2018
|
+
* Whether to capture a profile of the application.
|
|
2019
|
+
*/
|
|
2020
|
+
profile?: Profile;
|
|
2021
|
+
/**
|
|
2022
|
+
* Whether to fail on the first error.
|
|
2023
|
+
*/
|
|
2024
|
+
bail?: Bail;
|
|
2025
|
+
/**
|
|
2026
|
+
* Performance optimization options.
|
|
2027
|
+
*/
|
|
2028
|
+
performance?: Performance;
|
|
2029
|
+
};
|
|
2030
|
+
/** Configuration for Rspack */
|
|
2031
|
+
export type Configuration = RspackOptions;
|
|
1646
2032
|
export {};
|