@rspack/core 1.4.0-beta.0 → 1.4.0-beta.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/dist/MultiCompiler.d.ts +4 -1
- package/dist/MultiWatching.d.ts +1 -0
- package/dist/builtin-loader/swc/types.d.ts +74 -55
- package/dist/builtin-plugin/lazy-compilation/middleware.d.ts +3 -3
- package/dist/config/devServer.d.ts +1 -1
- package/dist/config/normalization.d.ts +1 -0
- package/dist/config/types.d.ts +7 -0
- package/dist/config/zod.d.ts +57 -6
- package/dist/exports.d.ts +3 -1
- package/dist/index.js +599 -525
- package/dist/swc.d.ts +2 -0
- package/package.json +4 -4
@@ -1,4 +1,4 @@
|
|
1
|
-
import type
|
2
|
-
import type {
|
1
|
+
import { type Compiler, MultiCompiler } from "../..";
|
2
|
+
import type { MiddlewareHandler } from "../../config/devServer";
|
3
3
|
export declare const LAZY_COMPILATION_PREFIX = "/lazy-compilation-using-";
|
4
|
-
export declare const lazyCompilationMiddleware: (compiler: Compiler
|
4
|
+
export declare const lazyCompilationMiddleware: (compiler: Compiler | MultiCompiler) => MiddlewareHandler;
|
@@ -144,7 +144,7 @@ type DevMiddlewareContext<RequestInternal extends IncomingMessage = IncomingMess
|
|
144
144
|
outputFileSystem: OutputFileSystem;
|
145
145
|
};
|
146
146
|
type Server = any;
|
147
|
-
type MiddlewareHandler<RequestInternal extends Request = Request, ResponseInternal extends Response = Response> = (req: RequestInternal, res: ResponseInternal, next: NextFunction) => void | Promise<void>;
|
147
|
+
export type MiddlewareHandler<RequestInternal extends Request = Request, ResponseInternal extends Response = Response> = (req: RequestInternal, res: ResponseInternal, next: NextFunction) => void | Promise<void>;
|
148
148
|
type MiddlewareObject<RequestInternal extends Request = Request, ResponseInternal extends Response = Response> = {
|
149
149
|
name?: string;
|
150
150
|
path?: string;
|
@@ -107,6 +107,7 @@ export interface ExperimentsNormalized {
|
|
107
107
|
buildHttp?: HttpUriPluginOptions;
|
108
108
|
parallelLoader?: boolean;
|
109
109
|
useInputFileSystem?: false | RegExp[];
|
110
|
+
inlineConst?: boolean;
|
110
111
|
}
|
111
112
|
export type IgnoreWarningsNormalized = ((warning: Error, compilation: Compilation) => boolean)[];
|
112
113
|
export type OptimizationRuntimeChunkNormalized = false | {
|
package/dist/config/types.d.ts
CHANGED
@@ -787,6 +787,8 @@ export type JavascriptParserOptions = {
|
|
787
787
|
requireDynamic?: boolean;
|
788
788
|
requireResolve?: boolean;
|
789
789
|
importDynamic?: boolean;
|
790
|
+
/** Inline const values in this module */
|
791
|
+
inlineConst?: boolean;
|
790
792
|
};
|
791
793
|
export type JsonParserOptions = {
|
792
794
|
/**
|
@@ -2028,6 +2030,11 @@ export type Experiments = {
|
|
2028
2030
|
* @default false
|
2029
2031
|
*/
|
2030
2032
|
useInputFileSystem?: UseInputFileSystem;
|
2033
|
+
/**
|
2034
|
+
* Enable inline constants
|
2035
|
+
* @default false
|
2036
|
+
*/
|
2037
|
+
inlineConst?: boolean;
|
2031
2038
|
};
|
2032
2039
|
export type Watch = boolean;
|
2033
2040
|
/** Options for watch mode. */
|
package/dist/config/zod.d.ts
CHANGED
@@ -393,6 +393,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
393
393
|
umdNamedDefine?: boolean | undefined;
|
394
394
|
} | undefined;
|
395
395
|
path?: string | undefined;
|
396
|
+
charset?: boolean | undefined;
|
396
397
|
wasmLoading?: string | false | undefined;
|
397
398
|
cssHeadDataCompression?: boolean | undefined;
|
398
399
|
auxiliaryComment?: string | {
|
@@ -445,7 +446,6 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
445
446
|
devtoolModuleFilenameTemplate?: string | ((...args: unknown[]) => any) | undefined;
|
446
447
|
devtoolFallbackModuleFilenameTemplate?: string | ((...args: unknown[]) => any) | undefined;
|
447
448
|
chunkLoadTimeout?: number | undefined;
|
448
|
-
charset?: boolean | undefined;
|
449
449
|
compareBeforeEmit?: boolean | undefined;
|
450
450
|
}, {
|
451
451
|
module?: boolean | undefined;
|
@@ -492,6 +492,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
492
492
|
umdNamedDefine?: boolean | undefined;
|
493
493
|
} | undefined;
|
494
494
|
path?: string | undefined;
|
495
|
+
charset?: boolean | undefined;
|
495
496
|
wasmLoading?: string | false | undefined;
|
496
497
|
cssHeadDataCompression?: boolean | undefined;
|
497
498
|
auxiliaryComment?: string | {
|
@@ -544,7 +545,6 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
544
545
|
devtoolModuleFilenameTemplate?: string | ((...args: unknown[]) => any) | undefined;
|
545
546
|
devtoolFallbackModuleFilenameTemplate?: string | ((...args: unknown[]) => any) | undefined;
|
546
547
|
chunkLoadTimeout?: number | undefined;
|
547
|
-
charset?: boolean | undefined;
|
548
548
|
compareBeforeEmit?: boolean | undefined;
|
549
549
|
}>>;
|
550
550
|
target: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<false>, z.ZodUnion<[z.ZodEnum<["web", "webworker", "es3", "es5", "es2015", "es2016", "es2017", "es2018", "es2019", "es2020", "es2021", "es2022"]>, z.ZodLiteral<"node">, z.ZodLiteral<"async-node">, z.ZodType<`node${number}`, z.ZodTypeDef, `node${number}`>, z.ZodType<`async-node${number}`, z.ZodTypeDef, `async-node${number}`>, z.ZodType<`node${number}.${number}`, z.ZodTypeDef, `node${number}.${number}`>, z.ZodType<`async-node${number}.${number}`, z.ZodTypeDef, `async-node${number}.${number}`>, z.ZodLiteral<"electron-main">, z.ZodType<`electron${number}-main`, z.ZodTypeDef, `electron${number}-main`>, z.ZodType<`electron${number}.${number}-main`, z.ZodTypeDef, `electron${number}.${number}-main`>, z.ZodLiteral<"electron-renderer">, z.ZodType<`electron${number}-renderer`, z.ZodTypeDef, `electron${number}-renderer`>, z.ZodType<`electron${number}.${number}-renderer`, z.ZodTypeDef, `electron${number}.${number}-renderer`>, z.ZodLiteral<"electron-preload">, z.ZodType<`electron${number}-preload`, z.ZodTypeDef, `electron${number}-preload`>, z.ZodType<`electron${number}.${number}-preload`, z.ZodTypeDef, `electron${number}.${number}-preload`>, z.ZodLiteral<"nwjs">, z.ZodType<`nwjs${number}`, z.ZodTypeDef, `nwjs${number}`>, z.ZodType<`nwjs${number}.${number}`, z.ZodTypeDef, `nwjs${number}.${number}`>, z.ZodLiteral<"node-webkit">, z.ZodType<`node-webkit${number}`, z.ZodTypeDef, `node-webkit${number}`>, z.ZodType<`node-webkit${number}.${number}`, z.ZodTypeDef, `node-webkit${number}.${number}`>, z.ZodLiteral<"browserslist">, z.ZodType<`browserslist:${string}`, z.ZodTypeDef, `browserslist:${string}`>]>, z.ZodArray<z.ZodUnion<[z.ZodEnum<["web", "webworker", "es3", "es5", "es2015", "es2016", "es2017", "es2018", "es2019", "es2020", "es2021", "es2022"]>, z.ZodLiteral<"node">, z.ZodLiteral<"async-node">, z.ZodType<`node${number}`, z.ZodTypeDef, `node${number}`>, z.ZodType<`async-node${number}`, z.ZodTypeDef, `async-node${number}`>, z.ZodType<`node${number}.${number}`, z.ZodTypeDef, `node${number}.${number}`>, z.ZodType<`async-node${number}.${number}`, z.ZodTypeDef, `async-node${number}.${number}`>, z.ZodLiteral<"electron-main">, z.ZodType<`electron${number}-main`, z.ZodTypeDef, `electron${number}-main`>, z.ZodType<`electron${number}.${number}-main`, z.ZodTypeDef, `electron${number}.${number}-main`>, z.ZodLiteral<"electron-renderer">, z.ZodType<`electron${number}-renderer`, z.ZodTypeDef, `electron${number}-renderer`>, z.ZodType<`electron${number}.${number}-renderer`, z.ZodTypeDef, `electron${number}.${number}-renderer`>, z.ZodLiteral<"electron-preload">, z.ZodType<`electron${number}-preload`, z.ZodTypeDef, `electron${number}-preload`>, z.ZodType<`electron${number}.${number}-preload`, z.ZodTypeDef, `electron${number}.${number}-preload`>, z.ZodLiteral<"nwjs">, z.ZodType<`nwjs${number}`, z.ZodTypeDef, `nwjs${number}`>, z.ZodType<`nwjs${number}.${number}`, z.ZodTypeDef, `nwjs${number}.${number}`>, z.ZodLiteral<"node-webkit">, z.ZodType<`node-webkit${number}`, z.ZodTypeDef, `node-webkit${number}`>, z.ZodType<`node-webkit${number}.${number}`, z.ZodTypeDef, `node-webkit${number}.${number}`>, z.ZodLiteral<"browserslist">, z.ZodType<`browserslist:${string}`, z.ZodTypeDef, `browserslist:${string}`>]>, "many">]>>;
|
@@ -736,6 +736,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
736
736
|
}>>;
|
737
737
|
parallelLoader: z.ZodOptional<z.ZodBoolean>;
|
738
738
|
useInputFileSystem: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<false>, z.ZodArray<z.ZodType<RegExp, z.ZodTypeDef, RegExp>, "many">]>>;
|
739
|
+
inlineConst: z.ZodOptional<z.ZodBoolean>;
|
739
740
|
}, "strict", z.ZodTypeAny, {
|
740
741
|
css?: boolean | undefined;
|
741
742
|
topLevelAwait?: boolean | undefined;
|
@@ -755,6 +756,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
755
756
|
directory?: string | undefined;
|
756
757
|
} | undefined;
|
757
758
|
} | undefined;
|
759
|
+
inlineConst?: boolean | undefined;
|
758
760
|
lazyCompilation?: boolean | {
|
759
761
|
entries?: boolean | undefined;
|
760
762
|
test?: RegExp | ((...args: unknown[]) => any) | undefined;
|
@@ -820,6 +822,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
820
822
|
directory?: string | undefined;
|
821
823
|
} | undefined;
|
822
824
|
} | undefined;
|
825
|
+
inlineConst?: boolean | undefined;
|
823
826
|
lazyCompilation?: boolean | {
|
824
827
|
entries?: boolean | undefined;
|
825
828
|
test?: RegExp | ((...args: unknown[]) => any) | undefined;
|
@@ -1629,6 +1632,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
1629
1632
|
requireDynamic: z.ZodOptional<z.ZodBoolean>;
|
1630
1633
|
requireResolve: z.ZodOptional<z.ZodBoolean>;
|
1631
1634
|
importDynamic: z.ZodOptional<z.ZodBoolean>;
|
1635
|
+
inlineConst: z.ZodOptional<z.ZodBoolean>;
|
1632
1636
|
}, "strict", z.ZodTypeAny, {
|
1633
1637
|
importMeta?: boolean | undefined;
|
1634
1638
|
url?: boolean | "relative" | undefined;
|
@@ -1649,6 +1653,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
1649
1653
|
requireDynamic?: boolean | undefined;
|
1650
1654
|
requireResolve?: boolean | undefined;
|
1651
1655
|
importDynamic?: boolean | undefined;
|
1656
|
+
inlineConst?: boolean | undefined;
|
1652
1657
|
}, {
|
1653
1658
|
importMeta?: boolean | undefined;
|
1654
1659
|
url?: boolean | "relative" | undefined;
|
@@ -1669,6 +1674,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
1669
1674
|
requireDynamic?: boolean | undefined;
|
1670
1675
|
requireResolve?: boolean | undefined;
|
1671
1676
|
importDynamic?: boolean | undefined;
|
1677
|
+
inlineConst?: boolean | undefined;
|
1672
1678
|
}>>;
|
1673
1679
|
"javascript/auto": z.ZodOptional<z.ZodObject<{
|
1674
1680
|
dynamicImportMode: z.ZodOptional<z.ZodEnum<["eager", "lazy", "weak", "lazy-once"]>>;
|
@@ -1690,6 +1696,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
1690
1696
|
requireDynamic: z.ZodOptional<z.ZodBoolean>;
|
1691
1697
|
requireResolve: z.ZodOptional<z.ZodBoolean>;
|
1692
1698
|
importDynamic: z.ZodOptional<z.ZodBoolean>;
|
1699
|
+
inlineConst: z.ZodOptional<z.ZodBoolean>;
|
1693
1700
|
}, "strict", z.ZodTypeAny, {
|
1694
1701
|
importMeta?: boolean | undefined;
|
1695
1702
|
url?: boolean | "relative" | undefined;
|
@@ -1710,6 +1717,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
1710
1717
|
requireDynamic?: boolean | undefined;
|
1711
1718
|
requireResolve?: boolean | undefined;
|
1712
1719
|
importDynamic?: boolean | undefined;
|
1720
|
+
inlineConst?: boolean | undefined;
|
1713
1721
|
}, {
|
1714
1722
|
importMeta?: boolean | undefined;
|
1715
1723
|
url?: boolean | "relative" | undefined;
|
@@ -1730,6 +1738,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
1730
1738
|
requireDynamic?: boolean | undefined;
|
1731
1739
|
requireResolve?: boolean | undefined;
|
1732
1740
|
importDynamic?: boolean | undefined;
|
1741
|
+
inlineConst?: boolean | undefined;
|
1733
1742
|
}>>;
|
1734
1743
|
"javascript/dynamic": z.ZodOptional<z.ZodObject<{
|
1735
1744
|
dynamicImportMode: z.ZodOptional<z.ZodEnum<["eager", "lazy", "weak", "lazy-once"]>>;
|
@@ -1751,6 +1760,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
1751
1760
|
requireDynamic: z.ZodOptional<z.ZodBoolean>;
|
1752
1761
|
requireResolve: z.ZodOptional<z.ZodBoolean>;
|
1753
1762
|
importDynamic: z.ZodOptional<z.ZodBoolean>;
|
1763
|
+
inlineConst: z.ZodOptional<z.ZodBoolean>;
|
1754
1764
|
}, "strict", z.ZodTypeAny, {
|
1755
1765
|
importMeta?: boolean | undefined;
|
1756
1766
|
url?: boolean | "relative" | undefined;
|
@@ -1771,6 +1781,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
1771
1781
|
requireDynamic?: boolean | undefined;
|
1772
1782
|
requireResolve?: boolean | undefined;
|
1773
1783
|
importDynamic?: boolean | undefined;
|
1784
|
+
inlineConst?: boolean | undefined;
|
1774
1785
|
}, {
|
1775
1786
|
importMeta?: boolean | undefined;
|
1776
1787
|
url?: boolean | "relative" | undefined;
|
@@ -1791,6 +1802,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
1791
1802
|
requireDynamic?: boolean | undefined;
|
1792
1803
|
requireResolve?: boolean | undefined;
|
1793
1804
|
importDynamic?: boolean | undefined;
|
1805
|
+
inlineConst?: boolean | undefined;
|
1794
1806
|
}>>;
|
1795
1807
|
"javascript/esm": z.ZodOptional<z.ZodObject<{
|
1796
1808
|
dynamicImportMode: z.ZodOptional<z.ZodEnum<["eager", "lazy", "weak", "lazy-once"]>>;
|
@@ -1812,6 +1824,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
1812
1824
|
requireDynamic: z.ZodOptional<z.ZodBoolean>;
|
1813
1825
|
requireResolve: z.ZodOptional<z.ZodBoolean>;
|
1814
1826
|
importDynamic: z.ZodOptional<z.ZodBoolean>;
|
1827
|
+
inlineConst: z.ZodOptional<z.ZodBoolean>;
|
1815
1828
|
}, "strict", z.ZodTypeAny, {
|
1816
1829
|
importMeta?: boolean | undefined;
|
1817
1830
|
url?: boolean | "relative" | undefined;
|
@@ -1832,6 +1845,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
1832
1845
|
requireDynamic?: boolean | undefined;
|
1833
1846
|
requireResolve?: boolean | undefined;
|
1834
1847
|
importDynamic?: boolean | undefined;
|
1848
|
+
inlineConst?: boolean | undefined;
|
1835
1849
|
}, {
|
1836
1850
|
importMeta?: boolean | undefined;
|
1837
1851
|
url?: boolean | "relative" | undefined;
|
@@ -1852,6 +1866,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
1852
1866
|
requireDynamic?: boolean | undefined;
|
1853
1867
|
requireResolve?: boolean | undefined;
|
1854
1868
|
importDynamic?: boolean | undefined;
|
1869
|
+
inlineConst?: boolean | undefined;
|
1855
1870
|
}>>;
|
1856
1871
|
}, "strict", z.ZodTypeAny, {
|
1857
1872
|
css?: {
|
@@ -1891,6 +1906,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
1891
1906
|
requireDynamic?: boolean | undefined;
|
1892
1907
|
requireResolve?: boolean | undefined;
|
1893
1908
|
importDynamic?: boolean | undefined;
|
1909
|
+
inlineConst?: boolean | undefined;
|
1894
1910
|
} | undefined;
|
1895
1911
|
"javascript/auto"?: {
|
1896
1912
|
importMeta?: boolean | undefined;
|
@@ -1912,6 +1928,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
1912
1928
|
requireDynamic?: boolean | undefined;
|
1913
1929
|
requireResolve?: boolean | undefined;
|
1914
1930
|
importDynamic?: boolean | undefined;
|
1931
|
+
inlineConst?: boolean | undefined;
|
1915
1932
|
} | undefined;
|
1916
1933
|
"javascript/dynamic"?: {
|
1917
1934
|
importMeta?: boolean | undefined;
|
@@ -1933,6 +1950,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
1933
1950
|
requireDynamic?: boolean | undefined;
|
1934
1951
|
requireResolve?: boolean | undefined;
|
1935
1952
|
importDynamic?: boolean | undefined;
|
1953
|
+
inlineConst?: boolean | undefined;
|
1936
1954
|
} | undefined;
|
1937
1955
|
"javascript/esm"?: {
|
1938
1956
|
importMeta?: boolean | undefined;
|
@@ -1954,6 +1972,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
1954
1972
|
requireDynamic?: boolean | undefined;
|
1955
1973
|
requireResolve?: boolean | undefined;
|
1956
1974
|
importDynamic?: boolean | undefined;
|
1975
|
+
inlineConst?: boolean | undefined;
|
1957
1976
|
} | undefined;
|
1958
1977
|
}, {
|
1959
1978
|
css?: {
|
@@ -1993,6 +2012,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
1993
2012
|
requireDynamic?: boolean | undefined;
|
1994
2013
|
requireResolve?: boolean | undefined;
|
1995
2014
|
importDynamic?: boolean | undefined;
|
2015
|
+
inlineConst?: boolean | undefined;
|
1996
2016
|
} | undefined;
|
1997
2017
|
"javascript/auto"?: {
|
1998
2018
|
importMeta?: boolean | undefined;
|
@@ -2014,6 +2034,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
2014
2034
|
requireDynamic?: boolean | undefined;
|
2015
2035
|
requireResolve?: boolean | undefined;
|
2016
2036
|
importDynamic?: boolean | undefined;
|
2037
|
+
inlineConst?: boolean | undefined;
|
2017
2038
|
} | undefined;
|
2018
2039
|
"javascript/dynamic"?: {
|
2019
2040
|
importMeta?: boolean | undefined;
|
@@ -2035,6 +2056,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
2035
2056
|
requireDynamic?: boolean | undefined;
|
2036
2057
|
requireResolve?: boolean | undefined;
|
2037
2058
|
importDynamic?: boolean | undefined;
|
2059
|
+
inlineConst?: boolean | undefined;
|
2038
2060
|
} | undefined;
|
2039
2061
|
"javascript/esm"?: {
|
2040
2062
|
importMeta?: boolean | undefined;
|
@@ -2056,6 +2078,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
2056
2078
|
requireDynamic?: boolean | undefined;
|
2057
2079
|
requireResolve?: boolean | undefined;
|
2058
2080
|
importDynamic?: boolean | undefined;
|
2081
|
+
inlineConst?: boolean | undefined;
|
2059
2082
|
} | undefined;
|
2060
2083
|
}>>;
|
2061
2084
|
generator: z.ZodOptional<z.ZodObject<{
|
@@ -2306,6 +2329,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
2306
2329
|
requireDynamic?: boolean | undefined;
|
2307
2330
|
requireResolve?: boolean | undefined;
|
2308
2331
|
importDynamic?: boolean | undefined;
|
2332
|
+
inlineConst?: boolean | undefined;
|
2309
2333
|
} | undefined;
|
2310
2334
|
"javascript/auto"?: {
|
2311
2335
|
importMeta?: boolean | undefined;
|
@@ -2327,6 +2351,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
2327
2351
|
requireDynamic?: boolean | undefined;
|
2328
2352
|
requireResolve?: boolean | undefined;
|
2329
2353
|
importDynamic?: boolean | undefined;
|
2354
|
+
inlineConst?: boolean | undefined;
|
2330
2355
|
} | undefined;
|
2331
2356
|
"javascript/dynamic"?: {
|
2332
2357
|
importMeta?: boolean | undefined;
|
@@ -2348,6 +2373,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
2348
2373
|
requireDynamic?: boolean | undefined;
|
2349
2374
|
requireResolve?: boolean | undefined;
|
2350
2375
|
importDynamic?: boolean | undefined;
|
2376
|
+
inlineConst?: boolean | undefined;
|
2351
2377
|
} | undefined;
|
2352
2378
|
"javascript/esm"?: {
|
2353
2379
|
importMeta?: boolean | undefined;
|
@@ -2369,6 +2395,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
2369
2395
|
requireDynamic?: boolean | undefined;
|
2370
2396
|
requireResolve?: boolean | undefined;
|
2371
2397
|
importDynamic?: boolean | undefined;
|
2398
|
+
inlineConst?: boolean | undefined;
|
2372
2399
|
} | undefined;
|
2373
2400
|
} | undefined;
|
2374
2401
|
generator?: {
|
@@ -2456,6 +2483,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
2456
2483
|
requireDynamic?: boolean | undefined;
|
2457
2484
|
requireResolve?: boolean | undefined;
|
2458
2485
|
importDynamic?: boolean | undefined;
|
2486
|
+
inlineConst?: boolean | undefined;
|
2459
2487
|
} | undefined;
|
2460
2488
|
"javascript/auto"?: {
|
2461
2489
|
importMeta?: boolean | undefined;
|
@@ -2477,6 +2505,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
2477
2505
|
requireDynamic?: boolean | undefined;
|
2478
2506
|
requireResolve?: boolean | undefined;
|
2479
2507
|
importDynamic?: boolean | undefined;
|
2508
|
+
inlineConst?: boolean | undefined;
|
2480
2509
|
} | undefined;
|
2481
2510
|
"javascript/dynamic"?: {
|
2482
2511
|
importMeta?: boolean | undefined;
|
@@ -2498,6 +2527,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
2498
2527
|
requireDynamic?: boolean | undefined;
|
2499
2528
|
requireResolve?: boolean | undefined;
|
2500
2529
|
importDynamic?: boolean | undefined;
|
2530
|
+
inlineConst?: boolean | undefined;
|
2501
2531
|
} | undefined;
|
2502
2532
|
"javascript/esm"?: {
|
2503
2533
|
importMeta?: boolean | undefined;
|
@@ -2519,6 +2549,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
2519
2549
|
requireDynamic?: boolean | undefined;
|
2520
2550
|
requireResolve?: boolean | undefined;
|
2521
2551
|
importDynamic?: boolean | undefined;
|
2552
|
+
inlineConst?: boolean | undefined;
|
2522
2553
|
} | undefined;
|
2523
2554
|
} | undefined;
|
2524
2555
|
generator?: {
|
@@ -2628,6 +2659,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
2628
2659
|
requireDynamic?: boolean | undefined;
|
2629
2660
|
requireResolve?: boolean | undefined;
|
2630
2661
|
importDynamic?: boolean | undefined;
|
2662
|
+
inlineConst?: boolean | undefined;
|
2631
2663
|
} | undefined;
|
2632
2664
|
"javascript/auto"?: {
|
2633
2665
|
importMeta?: boolean | undefined;
|
@@ -2649,6 +2681,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
2649
2681
|
requireDynamic?: boolean | undefined;
|
2650
2682
|
requireResolve?: boolean | undefined;
|
2651
2683
|
importDynamic?: boolean | undefined;
|
2684
|
+
inlineConst?: boolean | undefined;
|
2652
2685
|
} | undefined;
|
2653
2686
|
"javascript/dynamic"?: {
|
2654
2687
|
importMeta?: boolean | undefined;
|
@@ -2670,6 +2703,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
2670
2703
|
requireDynamic?: boolean | undefined;
|
2671
2704
|
requireResolve?: boolean | undefined;
|
2672
2705
|
importDynamic?: boolean | undefined;
|
2706
|
+
inlineConst?: boolean | undefined;
|
2673
2707
|
} | undefined;
|
2674
2708
|
"javascript/esm"?: {
|
2675
2709
|
importMeta?: boolean | undefined;
|
@@ -2691,6 +2725,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
2691
2725
|
requireDynamic?: boolean | undefined;
|
2692
2726
|
requireResolve?: boolean | undefined;
|
2693
2727
|
importDynamic?: boolean | undefined;
|
2728
|
+
inlineConst?: boolean | undefined;
|
2694
2729
|
} | undefined;
|
2695
2730
|
} | undefined;
|
2696
2731
|
generator?: {
|
@@ -2827,6 +2862,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
2827
2862
|
umdNamedDefine?: boolean | undefined;
|
2828
2863
|
} | undefined;
|
2829
2864
|
path?: string | undefined;
|
2865
|
+
charset?: boolean | undefined;
|
2830
2866
|
wasmLoading?: string | false | undefined;
|
2831
2867
|
cssHeadDataCompression?: boolean | undefined;
|
2832
2868
|
auxiliaryComment?: string | {
|
@@ -2879,7 +2915,6 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
2879
2915
|
devtoolModuleFilenameTemplate?: string | ((...args: unknown[]) => any) | undefined;
|
2880
2916
|
devtoolFallbackModuleFilenameTemplate?: string | ((...args: unknown[]) => any) | undefined;
|
2881
2917
|
chunkLoadTimeout?: number | undefined;
|
2882
|
-
charset?: boolean | undefined;
|
2883
2918
|
compareBeforeEmit?: boolean | undefined;
|
2884
2919
|
} | undefined;
|
2885
2920
|
node?: false | {
|
@@ -2910,6 +2945,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
2910
2945
|
directory?: string | undefined;
|
2911
2946
|
} | undefined;
|
2912
2947
|
} | undefined;
|
2948
|
+
inlineConst?: boolean | undefined;
|
2913
2949
|
lazyCompilation?: boolean | {
|
2914
2950
|
entries?: boolean | undefined;
|
2915
2951
|
test?: RegExp | ((...args: unknown[]) => any) | undefined;
|
@@ -3180,6 +3216,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
3180
3216
|
requireDynamic?: boolean | undefined;
|
3181
3217
|
requireResolve?: boolean | undefined;
|
3182
3218
|
importDynamic?: boolean | undefined;
|
3219
|
+
inlineConst?: boolean | undefined;
|
3183
3220
|
} | undefined;
|
3184
3221
|
"javascript/auto"?: {
|
3185
3222
|
importMeta?: boolean | undefined;
|
@@ -3201,6 +3238,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
3201
3238
|
requireDynamic?: boolean | undefined;
|
3202
3239
|
requireResolve?: boolean | undefined;
|
3203
3240
|
importDynamic?: boolean | undefined;
|
3241
|
+
inlineConst?: boolean | undefined;
|
3204
3242
|
} | undefined;
|
3205
3243
|
"javascript/dynamic"?: {
|
3206
3244
|
importMeta?: boolean | undefined;
|
@@ -3222,6 +3260,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
3222
3260
|
requireDynamic?: boolean | undefined;
|
3223
3261
|
requireResolve?: boolean | undefined;
|
3224
3262
|
importDynamic?: boolean | undefined;
|
3263
|
+
inlineConst?: boolean | undefined;
|
3225
3264
|
} | undefined;
|
3226
3265
|
"javascript/esm"?: {
|
3227
3266
|
importMeta?: boolean | undefined;
|
@@ -3243,6 +3282,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
3243
3282
|
requireDynamic?: boolean | undefined;
|
3244
3283
|
requireResolve?: boolean | undefined;
|
3245
3284
|
importDynamic?: boolean | undefined;
|
3285
|
+
inlineConst?: boolean | undefined;
|
3246
3286
|
} | undefined;
|
3247
3287
|
} | undefined;
|
3248
3288
|
generator?: {
|
@@ -3379,6 +3419,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
3379
3419
|
umdNamedDefine?: boolean | undefined;
|
3380
3420
|
} | undefined;
|
3381
3421
|
path?: string | undefined;
|
3422
|
+
charset?: boolean | undefined;
|
3382
3423
|
wasmLoading?: string | false | undefined;
|
3383
3424
|
cssHeadDataCompression?: boolean | undefined;
|
3384
3425
|
auxiliaryComment?: string | {
|
@@ -3431,7 +3472,6 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
3431
3472
|
devtoolModuleFilenameTemplate?: string | ((...args: unknown[]) => any) | undefined;
|
3432
3473
|
devtoolFallbackModuleFilenameTemplate?: string | ((...args: unknown[]) => any) | undefined;
|
3433
3474
|
chunkLoadTimeout?: number | undefined;
|
3434
|
-
charset?: boolean | undefined;
|
3435
3475
|
compareBeforeEmit?: boolean | undefined;
|
3436
3476
|
} | undefined;
|
3437
3477
|
node?: false | {
|
@@ -3462,6 +3502,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
3462
3502
|
directory?: string | undefined;
|
3463
3503
|
} | undefined;
|
3464
3504
|
} | undefined;
|
3505
|
+
inlineConst?: boolean | undefined;
|
3465
3506
|
lazyCompilation?: boolean | {
|
3466
3507
|
entries?: boolean | undefined;
|
3467
3508
|
test?: RegExp | ((...args: unknown[]) => any) | undefined;
|
@@ -3732,6 +3773,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
3732
3773
|
requireDynamic?: boolean | undefined;
|
3733
3774
|
requireResolve?: boolean | undefined;
|
3734
3775
|
importDynamic?: boolean | undefined;
|
3776
|
+
inlineConst?: boolean | undefined;
|
3735
3777
|
} | undefined;
|
3736
3778
|
"javascript/auto"?: {
|
3737
3779
|
importMeta?: boolean | undefined;
|
@@ -3753,6 +3795,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
3753
3795
|
requireDynamic?: boolean | undefined;
|
3754
3796
|
requireResolve?: boolean | undefined;
|
3755
3797
|
importDynamic?: boolean | undefined;
|
3798
|
+
inlineConst?: boolean | undefined;
|
3756
3799
|
} | undefined;
|
3757
3800
|
"javascript/dynamic"?: {
|
3758
3801
|
importMeta?: boolean | undefined;
|
@@ -3774,6 +3817,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
3774
3817
|
requireDynamic?: boolean | undefined;
|
3775
3818
|
requireResolve?: boolean | undefined;
|
3776
3819
|
importDynamic?: boolean | undefined;
|
3820
|
+
inlineConst?: boolean | undefined;
|
3777
3821
|
} | undefined;
|
3778
3822
|
"javascript/esm"?: {
|
3779
3823
|
importMeta?: boolean | undefined;
|
@@ -3795,6 +3839,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
3795
3839
|
requireDynamic?: boolean | undefined;
|
3796
3840
|
requireResolve?: boolean | undefined;
|
3797
3841
|
importDynamic?: boolean | undefined;
|
3842
|
+
inlineConst?: boolean | undefined;
|
3798
3843
|
} | undefined;
|
3799
3844
|
} | undefined;
|
3800
3845
|
generator?: {
|
@@ -3931,6 +3976,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
3931
3976
|
umdNamedDefine?: boolean | undefined;
|
3932
3977
|
} | undefined;
|
3933
3978
|
path?: string | undefined;
|
3979
|
+
charset?: boolean | undefined;
|
3934
3980
|
wasmLoading?: string | false | undefined;
|
3935
3981
|
cssHeadDataCompression?: boolean | undefined;
|
3936
3982
|
auxiliaryComment?: string | {
|
@@ -3983,7 +4029,6 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
3983
4029
|
devtoolModuleFilenameTemplate?: string | ((...args: unknown[]) => any) | undefined;
|
3984
4030
|
devtoolFallbackModuleFilenameTemplate?: string | ((...args: unknown[]) => any) | undefined;
|
3985
4031
|
chunkLoadTimeout?: number | undefined;
|
3986
|
-
charset?: boolean | undefined;
|
3987
4032
|
compareBeforeEmit?: boolean | undefined;
|
3988
4033
|
} | undefined;
|
3989
4034
|
node?: false | {
|
@@ -4014,6 +4059,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
4014
4059
|
directory?: string | undefined;
|
4015
4060
|
} | undefined;
|
4016
4061
|
} | undefined;
|
4062
|
+
inlineConst?: boolean | undefined;
|
4017
4063
|
lazyCompilation?: boolean | {
|
4018
4064
|
entries?: boolean | undefined;
|
4019
4065
|
test?: RegExp | ((...args: unknown[]) => any) | undefined;
|
@@ -4284,6 +4330,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
4284
4330
|
requireDynamic?: boolean | undefined;
|
4285
4331
|
requireResolve?: boolean | undefined;
|
4286
4332
|
importDynamic?: boolean | undefined;
|
4333
|
+
inlineConst?: boolean | undefined;
|
4287
4334
|
} | undefined;
|
4288
4335
|
"javascript/auto"?: {
|
4289
4336
|
importMeta?: boolean | undefined;
|
@@ -4305,6 +4352,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
4305
4352
|
requireDynamic?: boolean | undefined;
|
4306
4353
|
requireResolve?: boolean | undefined;
|
4307
4354
|
importDynamic?: boolean | undefined;
|
4355
|
+
inlineConst?: boolean | undefined;
|
4308
4356
|
} | undefined;
|
4309
4357
|
"javascript/dynamic"?: {
|
4310
4358
|
importMeta?: boolean | undefined;
|
@@ -4326,6 +4374,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
4326
4374
|
requireDynamic?: boolean | undefined;
|
4327
4375
|
requireResolve?: boolean | undefined;
|
4328
4376
|
importDynamic?: boolean | undefined;
|
4377
|
+
inlineConst?: boolean | undefined;
|
4329
4378
|
} | undefined;
|
4330
4379
|
"javascript/esm"?: {
|
4331
4380
|
importMeta?: boolean | undefined;
|
@@ -4347,6 +4396,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
4347
4396
|
requireDynamic?: boolean | undefined;
|
4348
4397
|
requireResolve?: boolean | undefined;
|
4349
4398
|
importDynamic?: boolean | undefined;
|
4399
|
+
inlineConst?: boolean | undefined;
|
4350
4400
|
} | undefined;
|
4351
4401
|
} | undefined;
|
4352
4402
|
generator?: {
|
@@ -4483,6 +4533,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
4483
4533
|
umdNamedDefine?: boolean | undefined;
|
4484
4534
|
} | undefined;
|
4485
4535
|
path?: string | undefined;
|
4536
|
+
charset?: boolean | undefined;
|
4486
4537
|
wasmLoading?: string | false | undefined;
|
4487
4538
|
cssHeadDataCompression?: boolean | undefined;
|
4488
4539
|
auxiliaryComment?: string | {
|
@@ -4535,7 +4586,6 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
4535
4586
|
devtoolModuleFilenameTemplate?: string | ((...args: unknown[]) => any) | undefined;
|
4536
4587
|
devtoolFallbackModuleFilenameTemplate?: string | ((...args: unknown[]) => any) | undefined;
|
4537
4588
|
chunkLoadTimeout?: number | undefined;
|
4538
|
-
charset?: boolean | undefined;
|
4539
4589
|
compareBeforeEmit?: boolean | undefined;
|
4540
4590
|
} | undefined;
|
4541
4591
|
node?: false | {
|
@@ -4566,6 +4616,7 @@ export declare const rspackOptions: z.ZodEffects<z.ZodObject<{
|
|
4566
4616
|
directory?: string | undefined;
|
4567
4617
|
} | undefined;
|
4568
4618
|
} | undefined;
|
4619
|
+
inlineConst?: boolean | undefined;
|
4569
4620
|
lazyCompilation?: boolean | {
|
4570
4621
|
entries?: boolean | undefined;
|
4571
4622
|
test?: RegExp | ((...args: unknown[]) => any) | undefined;
|
package/dist/exports.d.ts
CHANGED
@@ -173,7 +173,7 @@ export { ContextReplacementPlugin } from "./builtin-plugin";
|
|
173
173
|
export type { SwcLoaderEnvConfig, SwcLoaderEsParserConfig, SwcLoaderJscConfig, SwcLoaderModuleConfig, SwcLoaderOptions, SwcLoaderParserConfig, SwcLoaderTransformConfig, SwcLoaderTsParserConfig } from "./builtin-loader/swc/index";
|
174
174
|
export type { LoaderOptions as LightningcssLoaderOptions, FeatureOptions as LightningcssFeatureOptions } from "./builtin-loader/lightningcss/index";
|
175
175
|
export type { SubresourceIntegrityPluginOptions } from "./builtin-plugin";
|
176
|
-
import { minify, transform } from "./swc";
|
176
|
+
import { minify, minifySync, transform, transformSync } from "./swc";
|
177
177
|
interface Experiments {
|
178
178
|
globalTrace: {
|
179
179
|
register: (filter: string, layer: "logger" | "perfetto", output: string) => Promise<void>;
|
@@ -186,6 +186,8 @@ interface Experiments {
|
|
186
186
|
swc: {
|
187
187
|
transform: typeof transform;
|
188
188
|
minify: typeof minify;
|
189
|
+
transformSync: typeof transformSync;
|
190
|
+
minifySync: typeof minifySync;
|
189
191
|
};
|
190
192
|
CssChunkingPlugin: typeof CssChunkingPlugin;
|
191
193
|
}
|