@rsbuild/core 1.6.5 → 1.6.7-canary-57e2a56d-20251120152633
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/css-loader/index.js +18 -18
- package/compiled/html-rspack-plugin/index.js +15 -15
- package/compiled/html-rspack-plugin/package.json +1 -1
- package/compiled/memfs/index.d.ts +1 -0
- package/compiled/memfs/index.js +135 -121
- package/compiled/memfs/package.json +1 -1
- package/compiled/postcss-loader/index.js +6 -6
- package/compiled/rspack-manifest-plugin/index.js +4 -4
- package/dist/0~open.js +335 -345
- package/dist/0~range-parser.js +3 -6
- package/dist/169.js +9810 -0
- package/dist/476.mjs +8 -0
- package/dist/client/overlay.js +3 -3
- package/dist/ignoreCssLoader.mjs +2 -3
- package/dist/index.cjs +88 -97
- package/dist/index.js +1 -9899
- package/dist/rslib-runtime.js +44 -0
- package/dist/transformLoader.mjs +3 -9
- package/dist/transformRawLoader.mjs +4 -9
- package/dist-types/hooks.d.ts +2 -2
- package/dist-types/types/config.d.ts +37 -7
- package/dist-types/types/context.d.ts +2 -0
- package/dist-types/types/hooks.d.ts +4 -0
- package/dist-types/types/rsbuild.d.ts +1 -1
- package/package.json +9 -9
- /package/dist/{index.js.LICENSE.txt → 169.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
var leafPrototypes, getProto, __webpack_modules__ = {}, __webpack_module_cache__ = {};
|
|
2
|
+
function __webpack_require__(moduleId) {
|
|
3
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
4
|
+
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
5
|
+
var module = __webpack_module_cache__[moduleId] = {
|
|
6
|
+
exports: {}
|
|
7
|
+
};
|
|
8
|
+
return __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__), module.exports;
|
|
9
|
+
}
|
|
10
|
+
__webpack_require__.m = __webpack_modules__, __webpack_require__.add = function registerModules(modules) {
|
|
11
|
+
Object.assign(__webpack_require__.m, modules);
|
|
12
|
+
}, __webpack_require__.n = (module)=>{
|
|
13
|
+
var getter = module && module.__esModule ? ()=>module.default : ()=>module;
|
|
14
|
+
return __webpack_require__.d(getter, {
|
|
15
|
+
a: getter
|
|
16
|
+
}), getter;
|
|
17
|
+
}, getProto = Object.getPrototypeOf ? (obj)=>Object.getPrototypeOf(obj) : (obj)=>obj.__proto__, __webpack_require__.t = function(value, mode) {
|
|
18
|
+
if (1 & mode && (value = this(value)), 8 & mode || 'object' == typeof value && value && (4 & mode && value.__esModule || 16 & mode && 'function' == typeof value.then)) return value;
|
|
19
|
+
var ns = Object.create(null);
|
|
20
|
+
__webpack_require__.r(ns);
|
|
21
|
+
var def = {};
|
|
22
|
+
leafPrototypes = leafPrototypes || [
|
|
23
|
+
null,
|
|
24
|
+
getProto({}),
|
|
25
|
+
getProto([]),
|
|
26
|
+
getProto(getProto)
|
|
27
|
+
];
|
|
28
|
+
for(var current = 2 & mode && value; ('object' == typeof current || 'function' == typeof current) && !~leafPrototypes.indexOf(current); current = getProto(current))Object.getOwnPropertyNames(current).forEach((key)=>{
|
|
29
|
+
def[key] = ()=>value[key];
|
|
30
|
+
});
|
|
31
|
+
return def.default = ()=>value, __webpack_require__.d(ns, def), ns;
|
|
32
|
+
}, __webpack_require__.d = (exports, definition)=>{
|
|
33
|
+
for(var key in definition)__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key) && Object.defineProperty(exports, key, {
|
|
34
|
+
enumerable: !0,
|
|
35
|
+
get: definition[key]
|
|
36
|
+
});
|
|
37
|
+
}, __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop), __webpack_require__.r = (exports)=>{
|
|
38
|
+
'undefined' != typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports, Symbol.toStringTag, {
|
|
39
|
+
value: 'Module'
|
|
40
|
+
}), Object.defineProperty(exports, '__esModule', {
|
|
41
|
+
value: !0
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
export { __webpack_require__ };
|
package/dist/transformLoader.mjs
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { fileURLToPath } from "node:url";
|
|
4
|
-
let constants_dirname = dirname(fileURLToPath(import.meta.url));
|
|
5
|
-
process.platform, join(constants_dirname), join(constants_dirname, '../static');
|
|
6
|
-
let COMPILED_PATH = join(constants_dirname, '../compiled'), vendors_require = createRequire(import.meta.url), requireCompiledPackage = (name)=>vendors_require(`${COMPILED_PATH}/${name}/index.js`);
|
|
7
|
-
requireCompiledPackage('picocolors');
|
|
8
|
-
let loader_transformLoader = async function transform(source, map) {
|
|
1
|
+
import { requireCompiledPackage } from "./476.mjs";
|
|
2
|
+
let transformLoader = async function transform(source, map) {
|
|
9
3
|
let callback = this.async(), bypass = ()=>{
|
|
10
4
|
callback(null, source, map);
|
|
11
5
|
}, { id: transformId, getEnvironment } = this.getOptions();
|
|
@@ -39,4 +33,4 @@ let loader_transformLoader = async function transform(source, map) {
|
|
|
39
33
|
error instanceof Error ? callback(error) : callback(Error(String(error)));
|
|
40
34
|
}
|
|
41
35
|
};
|
|
42
|
-
export
|
|
36
|
+
export default transformLoader;
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { fileURLToPath } from "node:url";
|
|
4
|
-
let constants_dirname = dirname(fileURLToPath(import.meta.url));
|
|
5
|
-
process.platform, join(constants_dirname), join(constants_dirname, '../static');
|
|
6
|
-
let COMPILED_PATH = join(constants_dirname, '../compiled'), vendors_require = createRequire(import.meta.url), requireCompiledPackage = (name)=>vendors_require(`${COMPILED_PATH}/${name}/index.js`);
|
|
7
|
-
requireCompiledPackage('picocolors');
|
|
8
|
-
let transformRawLoader = async function transform(source, map) {
|
|
1
|
+
import { requireCompiledPackage } from "./476.mjs";
|
|
2
|
+
let transformLoader = async function transform(source, map) {
|
|
9
3
|
let callback = this.async(), bypass = ()=>{
|
|
10
4
|
callback(null, source, map);
|
|
11
5
|
}, { id: transformId, getEnvironment } = this.getOptions();
|
|
@@ -39,4 +33,5 @@ let transformRawLoader = async function transform(source, map) {
|
|
|
39
33
|
error instanceof Error ? callback(error) : callback(Error(String(error)));
|
|
40
34
|
}
|
|
41
35
|
}, raw = !0;
|
|
42
|
-
export
|
|
36
|
+
export default transformLoader;
|
|
37
|
+
export { raw };
|
package/dist-types/hooks.d.ts
CHANGED
|
@@ -30,14 +30,14 @@ export declare function initHooks(): {
|
|
|
30
30
|
};
|
|
31
31
|
export type Hooks = ReturnType<typeof initHooks>;
|
|
32
32
|
export declare const registerBuildHook: ({ context, isWatch, compiler, bundlerConfigs, MultiStatsCtor, }: {
|
|
33
|
-
bundlerConfigs
|
|
33
|
+
bundlerConfigs: Rspack.Configuration[];
|
|
34
34
|
context: InternalContext;
|
|
35
35
|
compiler: Rspack.Compiler | Rspack.MultiCompiler;
|
|
36
36
|
isWatch: boolean;
|
|
37
37
|
MultiStatsCtor: new (stats: Rspack.Stats[]) => Rspack.MultiStats;
|
|
38
38
|
}) => void;
|
|
39
39
|
export declare const registerDevHook: ({ context, compiler, bundlerConfigs, MultiStatsCtor, }: {
|
|
40
|
-
bundlerConfigs
|
|
40
|
+
bundlerConfigs: Rspack.Configuration[];
|
|
41
41
|
context: InternalContext;
|
|
42
42
|
compiler: Rspack.Compiler | Rspack.MultiCompiler;
|
|
43
43
|
MultiStatsCtor: new (stats: Rspack.Stats[]) => Rspack.MultiStats;
|
|
@@ -19,9 +19,18 @@ import type { Connect, CSSExtractOptions, CSSLoaderModulesOptions, CSSLoaderOpti
|
|
|
19
19
|
import type { ConfigChain, ConfigChainMergeContext, ConfigChainWithContext, LiteralUnion, MaybePromise, OneOrMany, Optional, TwoLevelReadonly } from './utils';
|
|
20
20
|
export type ToolsSwcConfig = ConfigChain<SwcLoaderOptions>;
|
|
21
21
|
export type ToolsBundlerChainConfig = OneOrMany<(chain: RspackChain, utils: ModifyBundlerChainUtils) => MaybePromise<void>>;
|
|
22
|
-
export type
|
|
23
|
-
addPlugins: (plugins: LoosePostCSSPlugin | LoosePostCSSPlugin[]
|
|
24
|
-
|
|
22
|
+
export type ToolsPostCSSContext = {
|
|
23
|
+
addPlugins: (plugins: LoosePostCSSPlugin | LoosePostCSSPlugin[], options?: {
|
|
24
|
+
/**
|
|
25
|
+
* Controls where the plugin is placed relative to the existing PostCSS plugins.
|
|
26
|
+
* - `pre`: Insert the plugin before all existing plugins.
|
|
27
|
+
* - `post`: Insert the plugin after all existing plugins.
|
|
28
|
+
* @default `post`
|
|
29
|
+
*/
|
|
30
|
+
order?: 'pre' | 'post';
|
|
31
|
+
}) => void;
|
|
32
|
+
};
|
|
33
|
+
export type ToolsPostCSSLoaderConfig = ConfigChainWithContext<PostCSSLoaderOptions, ToolsPostCSSContext>;
|
|
25
34
|
export type ToolsCSSLoaderConfig = ConfigChain<CSSLoaderOptions>;
|
|
26
35
|
export type ToolsStyleLoaderConfig = ConfigChain<StyleLoaderOptions>;
|
|
27
36
|
export type ToolsHtmlPluginConfig = ConfigChainWithContext<HtmlRspackPlugin.Options, {
|
|
@@ -592,6 +601,7 @@ export interface PerformanceConfig {
|
|
|
592
601
|
/**
|
|
593
602
|
* To enable or configure persistent build cache.
|
|
594
603
|
* @experimental This feature is experimental and may be changed in the future.
|
|
604
|
+
* @default false
|
|
595
605
|
*/
|
|
596
606
|
buildCache?: BuildCacheOptions | boolean;
|
|
597
607
|
/**
|
|
@@ -606,6 +616,7 @@ export interface PerformanceConfig {
|
|
|
606
616
|
chunkSplit?: ChunkSplit;
|
|
607
617
|
/**
|
|
608
618
|
* Analyze the size of output files.
|
|
619
|
+
* @default undefined
|
|
609
620
|
*/
|
|
610
621
|
bundleAnalyze?: BundleAnalyzerPlugin.Options;
|
|
611
622
|
/**
|
|
@@ -635,6 +646,7 @@ export interface PerformanceConfig {
|
|
|
635
646
|
* type: 'async-chunks',
|
|
636
647
|
* };
|
|
637
648
|
* ```
|
|
649
|
+
* @default undefined
|
|
638
650
|
*/
|
|
639
651
|
preload?: true | PreloadOptions;
|
|
640
652
|
/**
|
|
@@ -651,11 +663,13 @@ export interface PerformanceConfig {
|
|
|
651
663
|
* type: 'async-chunks',
|
|
652
664
|
* };
|
|
653
665
|
* ```
|
|
666
|
+
* @default undefined
|
|
654
667
|
*/
|
|
655
668
|
prefetch?: true | PrefetchOptions;
|
|
656
669
|
/**
|
|
657
670
|
* Whether capture timing information for each module,
|
|
658
671
|
* same as the [profile](https://rspack.rs/config/other-options#profile) config of Rspack.
|
|
672
|
+
* @default false
|
|
659
673
|
*/
|
|
660
674
|
profile?: boolean;
|
|
661
675
|
}
|
|
@@ -1024,6 +1038,7 @@ export interface OutputConfig {
|
|
|
1024
1038
|
* Set the size threshold to inline static assets such as images and fonts.
|
|
1025
1039
|
* By default, static assets will be Base64 encoded and inline into the page if
|
|
1026
1040
|
* the size is less than 4KiB.
|
|
1041
|
+
* @default { svg: 4096, font: 4096, image: 4096, media: 4096, assets: 4096 }
|
|
1027
1042
|
*/
|
|
1028
1043
|
dataUriLimit?: number | DataUriLimit;
|
|
1029
1044
|
/**
|
|
@@ -1490,8 +1505,18 @@ export type ClientConfig = {
|
|
|
1490
1505
|
export type NormalizedClientConfig = Optional<Required<ClientConfig>, 'protocol'>;
|
|
1491
1506
|
export type { ChokidarOptions };
|
|
1492
1507
|
export type WatchFiles = {
|
|
1508
|
+
/**
|
|
1509
|
+
* Paths of the files or directories to watch, supports glob syntax.
|
|
1510
|
+
*/
|
|
1493
1511
|
paths: string | string[];
|
|
1512
|
+
/**
|
|
1513
|
+
* Watch options passed to [chokidar](https://github.com/paulmillr/chokidar).
|
|
1514
|
+
*/
|
|
1494
1515
|
options?: ChokidarOptions;
|
|
1516
|
+
/**
|
|
1517
|
+
* Specifies whether to reload the page or restart the dev server when files change.
|
|
1518
|
+
* @default 'reload-page'
|
|
1519
|
+
*/
|
|
1495
1520
|
type?: 'reload-page' | 'reload-server';
|
|
1496
1521
|
};
|
|
1497
1522
|
export type CliShortcut = {
|
|
@@ -1513,8 +1538,9 @@ export type BrowserLogsStackTrace = 'summary' | 'full' | 'none';
|
|
|
1513
1538
|
export interface DevConfig {
|
|
1514
1539
|
/**
|
|
1515
1540
|
* Controls whether to forward browser runtime errors to the terminal. When `true`, the dev
|
|
1516
|
-
* client listens for window
|
|
1517
|
-
* where they are printed in the terminal (prefixed with
|
|
1541
|
+
* client listens for `window.error` events and unhandled Promise rejections in the browser,
|
|
1542
|
+
* then sends them to the dev server where they are printed in the terminal (prefixed with
|
|
1543
|
+
* `[browser]`).
|
|
1518
1544
|
* @default { stackTrace: 'summary' }
|
|
1519
1545
|
*/
|
|
1520
1546
|
browserLogs?: boolean | {
|
|
@@ -1542,6 +1568,7 @@ export interface DevConfig {
|
|
|
1542
1568
|
* Set the URL prefix of static assets in development mode,
|
|
1543
1569
|
* similar to the [output.publicPath](https://rspack.rs/config/output#outputpublicpath)
|
|
1544
1570
|
* config of Rspack.
|
|
1571
|
+
* @default `server.base`
|
|
1545
1572
|
*/
|
|
1546
1573
|
assetPrefix?: LiteralUnion<'auto', string> | boolean;
|
|
1547
1574
|
/**
|
|
@@ -1555,6 +1582,7 @@ export interface DevConfig {
|
|
|
1555
1582
|
client?: ClientConfig;
|
|
1556
1583
|
/**
|
|
1557
1584
|
* Whether to enable CLI shortcuts.
|
|
1585
|
+
* @default true when using Rsbuild CLI, otherwise false
|
|
1558
1586
|
*/
|
|
1559
1587
|
cliShortcuts?: boolean | {
|
|
1560
1588
|
/**
|
|
@@ -1574,6 +1602,7 @@ export interface DevConfig {
|
|
|
1574
1602
|
};
|
|
1575
1603
|
/**
|
|
1576
1604
|
* Used to add custom middleware to the dev server.
|
|
1605
|
+
* @default undefined
|
|
1577
1606
|
*/
|
|
1578
1607
|
setupMiddlewares?: SetupMiddlewaresFn | SetupMiddlewaresFn[];
|
|
1579
1608
|
/**
|
|
@@ -1584,11 +1613,12 @@ export interface DevConfig {
|
|
|
1584
1613
|
/**
|
|
1585
1614
|
* Watch specified files and directories for changes. When a file change is detected,
|
|
1586
1615
|
* it can trigger a page reload or restart the dev server.
|
|
1616
|
+
* @default undefined
|
|
1587
1617
|
*/
|
|
1588
1618
|
watchFiles?: WatchFiles | WatchFiles[];
|
|
1589
1619
|
/**
|
|
1590
|
-
* Enable lazy compilation.
|
|
1591
|
-
* @default false
|
|
1620
|
+
* Enable lazy compilation (compilation on demand).
|
|
1621
|
+
* @default { imports: true, entries: false }
|
|
1592
1622
|
*/
|
|
1593
1623
|
lazyCompilation?: boolean | Rspack.LazyCompilationOptions;
|
|
1594
1624
|
}
|
|
@@ -73,6 +73,8 @@ export type BuildState = {
|
|
|
73
73
|
status: BuildStatus;
|
|
74
74
|
/** Whether there are build errors */
|
|
75
75
|
hasErrors: boolean;
|
|
76
|
+
/** The build time of each environment */
|
|
77
|
+
time: Record<string, number>;
|
|
76
78
|
};
|
|
77
79
|
/** The inner context. */
|
|
78
80
|
export type InternalContext = RsbuildContext & {
|
|
@@ -32,6 +32,10 @@ export type OnBeforeDevCompileFn<B = 'rspack'> = (params: CompileCommonParams &
|
|
|
32
32
|
}) => MaybePromise<void>;
|
|
33
33
|
export type OnAfterEnvironmentCompileFn = (params: CompileCommonParams & {
|
|
34
34
|
stats?: Rspack.Stats;
|
|
35
|
+
/**
|
|
36
|
+
* The time it takes to build the current environment in milliseconds.
|
|
37
|
+
*/
|
|
38
|
+
time: number;
|
|
35
39
|
environment: EnvironmentContext;
|
|
36
40
|
}) => MaybePromise<void>;
|
|
37
41
|
export type OnAfterBuildFn = (params: CompileCommonParams & {
|
|
@@ -277,7 +277,7 @@ export type RsbuildEntryDescription = Rspack.EntryDescription & {
|
|
|
277
277
|
};
|
|
278
278
|
export type RsbuildEntry = Record<string, string | string[] | RsbuildEntryDescription>;
|
|
279
279
|
export type RsbuildMode = 'development' | 'production' | 'none';
|
|
280
|
-
export type RsbuildStatsItem = Pick<Rspack.StatsCompilation, 'errors' | 'warnings' | '
|
|
280
|
+
export type RsbuildStatsItem = Pick<Rspack.StatsCompilation, 'errors' | 'warnings' | 'entrypoints' | 'hash'>;
|
|
281
281
|
/**
|
|
282
282
|
* A subset of Rspack's StatsCompilation with only the fields we need
|
|
283
283
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/core",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.7-canary-57e2a56d-20251120152633",
|
|
4
4
|
"description": "The Rspack-based build tool.",
|
|
5
5
|
"homepage": "https://rsbuild.rs",
|
|
6
6
|
"bugs": {
|
|
@@ -46,19 +46,19 @@
|
|
|
46
46
|
"types.d.ts"
|
|
47
47
|
],
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@rspack/core": "1.6.
|
|
50
|
-
"@rspack/lite-tapable": "~1.0
|
|
49
|
+
"@rspack/core": "npm:@rspack-canary/core@1.6.5-canary-57e2a56d-20251120152633",
|
|
50
|
+
"@rspack/lite-tapable": "~1.1.0",
|
|
51
51
|
"@swc/helpers": "^0.5.17",
|
|
52
|
-
"core-js": "~3.
|
|
52
|
+
"core-js": "~3.47.0",
|
|
53
53
|
"jiti": "^2.6.1"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@jridgewell/remapping": "^2.3.5",
|
|
57
57
|
"@jridgewell/trace-mapping": "^0.3.31",
|
|
58
|
-
"@rslib/core": "0.
|
|
58
|
+
"@rslib/core": "0.18.0",
|
|
59
59
|
"@types/connect": "3.4.38",
|
|
60
60
|
"@types/cors": "^2.8.19",
|
|
61
|
-
"@types/node": "^24.
|
|
61
|
+
"@types/node": "^24.10.1",
|
|
62
62
|
"@types/on-finished": "2.3.5",
|
|
63
63
|
"@types/range-parser": "^1.2.7",
|
|
64
64
|
"@types/webpack-bundle-analyzer": "4.7.0",
|
|
@@ -71,10 +71,10 @@
|
|
|
71
71
|
"css-loader": "7.1.2",
|
|
72
72
|
"deepmerge": "^4.3.1",
|
|
73
73
|
"dotenv-expand": "12.0.3",
|
|
74
|
-
"html-rspack-plugin": "6.1.
|
|
74
|
+
"html-rspack-plugin": "6.1.4",
|
|
75
75
|
"http-proxy-middleware": "^2.0.9",
|
|
76
76
|
"launch-editor-middleware": "^2.12.0",
|
|
77
|
-
"memfs": "^4.
|
|
77
|
+
"memfs": "^4.51.0",
|
|
78
78
|
"mrmime": "^2.0.1",
|
|
79
79
|
"on-finished": "2.4.1",
|
|
80
80
|
"open": "^10.2.0",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"postcss": "^8.5.6",
|
|
83
83
|
"postcss-load-config": "6.0.1",
|
|
84
84
|
"postcss-loader": "8.2.0",
|
|
85
|
-
"prebundle": "1.
|
|
85
|
+
"prebundle": "1.6.0",
|
|
86
86
|
"range-parser": "^1.2.1",
|
|
87
87
|
"reduce-configs": "^1.1.1",
|
|
88
88
|
"rslog": "^1.3.0",
|
|
File without changes
|