@rsbuild/core 1.6.5 → 1.6.7

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.
@@ -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__ };
@@ -1,11 +1,5 @@
1
- import { createRequire } from "node:module";
2
- import { dirname, join } from "node:path";
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 { loader_transformLoader as default };
36
+ export default transformLoader;
@@ -1,11 +1,5 @@
1
- import { createRequire } from "node:module";
2
- import { dirname, join } from "node:path";
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 { transformRawLoader as default, raw };
36
+ export default transformLoader;
37
+ export { raw };
@@ -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?: Rspack.Configuration[];
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?: Rspack.Configuration[];
40
+ bundlerConfigs: Rspack.Configuration[];
41
41
  context: InternalContext;
42
42
  compiler: Rspack.Compiler | Rspack.MultiCompiler;
43
43
  MultiStatsCtor: new (stats: Rspack.Stats[]) => Rspack.MultiStats;
@@ -592,6 +592,7 @@ export interface PerformanceConfig {
592
592
  /**
593
593
  * To enable or configure persistent build cache.
594
594
  * @experimental This feature is experimental and may be changed in the future.
595
+ * @default false
595
596
  */
596
597
  buildCache?: BuildCacheOptions | boolean;
597
598
  /**
@@ -606,6 +607,7 @@ export interface PerformanceConfig {
606
607
  chunkSplit?: ChunkSplit;
607
608
  /**
608
609
  * Analyze the size of output files.
610
+ * @default undefined
609
611
  */
610
612
  bundleAnalyze?: BundleAnalyzerPlugin.Options;
611
613
  /**
@@ -635,6 +637,7 @@ export interface PerformanceConfig {
635
637
  * type: 'async-chunks',
636
638
  * };
637
639
  * ```
640
+ * @default undefined
638
641
  */
639
642
  preload?: true | PreloadOptions;
640
643
  /**
@@ -651,11 +654,13 @@ export interface PerformanceConfig {
651
654
  * type: 'async-chunks',
652
655
  * };
653
656
  * ```
657
+ * @default undefined
654
658
  */
655
659
  prefetch?: true | PrefetchOptions;
656
660
  /**
657
661
  * Whether capture timing information for each module,
658
662
  * same as the [profile](https://rspack.rs/config/other-options#profile) config of Rspack.
663
+ * @default false
659
664
  */
660
665
  profile?: boolean;
661
666
  }
@@ -1024,6 +1029,7 @@ export interface OutputConfig {
1024
1029
  * Set the size threshold to inline static assets such as images and fonts.
1025
1030
  * By default, static assets will be Base64 encoded and inline into the page if
1026
1031
  * the size is less than 4KiB.
1032
+ * @default { svg: 4096, font: 4096, image: 4096, media: 4096, assets: 4096 }
1027
1033
  */
1028
1034
  dataUriLimit?: number | DataUriLimit;
1029
1035
  /**
@@ -1490,8 +1496,18 @@ export type ClientConfig = {
1490
1496
  export type NormalizedClientConfig = Optional<Required<ClientConfig>, 'protocol'>;
1491
1497
  export type { ChokidarOptions };
1492
1498
  export type WatchFiles = {
1499
+ /**
1500
+ * Paths of the files or directories to watch, supports glob syntax.
1501
+ */
1493
1502
  paths: string | string[];
1503
+ /**
1504
+ * Watch options passed to [chokidar](https://github.com/paulmillr/chokidar).
1505
+ */
1494
1506
  options?: ChokidarOptions;
1507
+ /**
1508
+ * Specifies whether to reload the page or restart the dev server when files change.
1509
+ * @default 'reload-page'
1510
+ */
1495
1511
  type?: 'reload-page' | 'reload-server';
1496
1512
  };
1497
1513
  export type CliShortcut = {
@@ -1513,8 +1529,9 @@ export type BrowserLogsStackTrace = 'summary' | 'full' | 'none';
1513
1529
  export interface DevConfig {
1514
1530
  /**
1515
1531
  * Controls whether to forward browser runtime errors to the terminal. When `true`, the dev
1516
- * client listens for window `error` events in the browser and send them to the dev server,
1517
- * where they are printed in the terminal (prefixed with `[browser]`).
1532
+ * client listens for `window.error` events and unhandled Promise rejections in the browser,
1533
+ * then sends them to the dev server where they are printed in the terminal (prefixed with
1534
+ * `[browser]`).
1518
1535
  * @default { stackTrace: 'summary' }
1519
1536
  */
1520
1537
  browserLogs?: boolean | {
@@ -1542,6 +1559,7 @@ export interface DevConfig {
1542
1559
  * Set the URL prefix of static assets in development mode,
1543
1560
  * similar to the [output.publicPath](https://rspack.rs/config/output#outputpublicpath)
1544
1561
  * config of Rspack.
1562
+ * @default `server.base`
1545
1563
  */
1546
1564
  assetPrefix?: LiteralUnion<'auto', string> | boolean;
1547
1565
  /**
@@ -1555,6 +1573,7 @@ export interface DevConfig {
1555
1573
  client?: ClientConfig;
1556
1574
  /**
1557
1575
  * Whether to enable CLI shortcuts.
1576
+ * @default true when using Rsbuild CLI, otherwise false
1558
1577
  */
1559
1578
  cliShortcuts?: boolean | {
1560
1579
  /**
@@ -1574,6 +1593,7 @@ export interface DevConfig {
1574
1593
  };
1575
1594
  /**
1576
1595
  * Used to add custom middleware to the dev server.
1596
+ * @default undefined
1577
1597
  */
1578
1598
  setupMiddlewares?: SetupMiddlewaresFn | SetupMiddlewaresFn[];
1579
1599
  /**
@@ -1584,11 +1604,12 @@ export interface DevConfig {
1584
1604
  /**
1585
1605
  * Watch specified files and directories for changes. When a file change is detected,
1586
1606
  * it can trigger a page reload or restart the dev server.
1607
+ * @default undefined
1587
1608
  */
1588
1609
  watchFiles?: WatchFiles | WatchFiles[];
1589
1610
  /**
1590
- * Enable lazy compilation.
1591
- * @default false
1611
+ * Enable lazy compilation (compilation on demand).
1612
+ * @default { imports: true, entries: false }
1592
1613
  */
1593
1614
  lazyCompilation?: boolean | Rspack.LazyCompilationOptions;
1594
1615
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/core",
3
- "version": "1.6.5",
3
+ "version": "1.6.7",
4
4
  "description": "The Rspack-based build tool.",
5
5
  "homepage": "https://rsbuild.rs",
6
6
  "bugs": {
@@ -46,8 +46,8 @@
46
46
  "types.d.ts"
47
47
  ],
48
48
  "dependencies": {
49
- "@rspack/core": "1.6.1",
50
- "@rspack/lite-tapable": "~1.0.1",
49
+ "@rspack/core": "1.6.4",
50
+ "@rspack/lite-tapable": "~1.1.0",
51
51
  "@swc/helpers": "^0.5.17",
52
52
  "core-js": "~3.46.0",
53
53
  "jiti": "^2.6.1"
@@ -55,10 +55,10 @@
55
55
  "devDependencies": {
56
56
  "@jridgewell/remapping": "^2.3.5",
57
57
  "@jridgewell/trace-mapping": "^0.3.31",
58
- "@rslib/core": "0.17.1",
58
+ "@rslib/core": "0.18.0",
59
59
  "@types/connect": "3.4.38",
60
60
  "@types/cors": "^2.8.19",
61
- "@types/node": "^24.9.2",
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.3",
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.50.0",
77
+ "memfs": "^4.51.0",
78
78
  "mrmime": "^2.0.1",
79
79
  "on-finished": "2.4.1",
80
80
  "open": "^10.2.0",