@rsbuild/core 2.1.4 → 2.1.5

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.
@@ -1,4 +1,4 @@
1
- import { isCSSModules } from "./349.js";
1
+ import { isCSSModules } from "./252.js";
2
2
  let pitch = function() {
3
3
  let { modules } = this.getOptions();
4
4
  if (!isCSSModules(modules, this)) return '';
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export { PLUGIN_CSS_NAME, PLUGIN_SWC_NAME, createLogger, createRsbuild, defaultAllowedOrigins, defineConfig, ensureAssetPrefix, loadConfig, loadEnv, logger, mergeRsbuildConfig, rspack, runCLI, version } from "./756.js";
1
+ export { PLUGIN_CSS_NAME, PLUGIN_SWC_NAME, createLogger, createRsbuild, defaultAllowedOrigins, defineConfig, ensureAssetPrefix, loadConfig, loadEnv, logger, mergeRsbuildConfig, rspack, runCLI, version } from "./711.js";
@@ -1,5 +1,5 @@
1
1
  import { __webpack_require__ } from "./1~rslib-runtime.js";
2
- import "./756.js";
2
+ import "./711.js";
3
3
  __webpack_require__.add({
4
4
  "../../node_modules/.pnpm/launch-editor-middleware@2.14.1/node_modules/launch-editor-middleware/index.js" (module, __unused_rspack_exports, __webpack_require__) {
5
5
  let path = __webpack_require__("path?aeb1"), launch = __webpack_require__("../../node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/index.js");
@@ -1,7 +1,7 @@
1
1
  import { __webpack_require__ } from "./1~rslib-runtime.js";
2
- import "./756.js";
2
+ import "./711.js";
3
3
  __webpack_require__.add({
4
- "../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.1.2/node_modules/rspack-manifest-plugin/dist/helpers.js" (__unused_rspack_module, exports, __webpack_require__) {
4
+ "../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.1.3/node_modules/rspack-manifest-plugin/dist/helpers.js" (__unused_rspack_module, exports, __webpack_require__) {
5
5
  exports.transformFiles = exports.reduceChunk = exports.reduceAssets = exports.generateManifest = void 0;
6
6
  let node_path_1 = __webpack_require__("node:path?435f");
7
7
  exports.generateManifest = (compilation, files, { generate, seed = {} })=>generate ? generate(seed, files, Array.from(compilation.entrypoints.entries()).reduce((e, [name, entrypoint])=>Object.assign(e, {
@@ -61,9 +61,9 @@ __webpack_require__.add({
61
61
  'sort'
62
62
  ].filter((fname)=>!!options[fname]).reduce((prev, fname)=>prev[fname](options[fname]), files).map(standardizeFilePaths);
63
63
  },
64
- "../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.1.2/node_modules/rspack-manifest-plugin/dist/hooks.js" (__unused_rspack_module, exports, __webpack_require__) {
64
+ "../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.1.3/node_modules/rspack-manifest-plugin/dist/hooks.js" (__unused_rspack_module, exports, __webpack_require__) {
65
65
  exports.getCompilerHooks = exports.emitHook = exports.beforeRunHook = void 0;
66
- let node_fs_1 = __webpack_require__("node:fs?9592"), node_path_1 = __webpack_require__("node:path?435f"), lite_tapable_1 = __webpack_require__("../../node_modules/.pnpm/@rspack+lite-tapable@1.1.0/node_modules/@rspack/lite-tapable/dist/index.cjs"), helpers_1 = __webpack_require__("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.1.2/node_modules/rspack-manifest-plugin/dist/helpers.js"), compilerHookMap = new WeakMap(), getCompilerHooks = (compiler)=>{
66
+ let node_fs_1 = __webpack_require__("node:fs?9592"), node_path_1 = __webpack_require__("node:path?435f"), lite_tapable_1 = __webpack_require__("../../node_modules/.pnpm/@rspack+lite-tapable@1.1.0/node_modules/@rspack/lite-tapable/dist/index.cjs"), helpers_1 = __webpack_require__("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.1.3/node_modules/rspack-manifest-plugin/dist/helpers.js"), compilerHookMap = new WeakMap(), getCompilerHooks = (compiler)=>{
67
67
  let hooks = compilerHookMap.get(compiler);
68
68
  return void 0 === hooks && (hooks = {
69
69
  afterEmit: new lite_tapable_1.SyncWaterfallHook([
@@ -112,9 +112,9 @@ __webpack_require__.add({
112
112
  getCompilerHooks(compiler).afterEmit.call(manifest);
113
113
  };
114
114
  },
115
- "../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.1.2/node_modules/rspack-manifest-plugin/dist/index.js" (__unused_rspack_module, exports, __webpack_require__) {
115
+ "../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.1.3/node_modules/rspack-manifest-plugin/dist/index.js" (__unused_rspack_module, exports, __webpack_require__) {
116
116
  exports.RspackManifestPlugin = void 0;
117
- let node_path_1 = __webpack_require__("node:path?435f"), hooks_1 = __webpack_require__("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.1.2/node_modules/rspack-manifest-plugin/dist/hooks.js"), emitCountMap = new Map(), defaults = {
117
+ let node_path_1 = __webpack_require__("node:path?435f"), hooks_1 = __webpack_require__("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.1.3/node_modules/rspack-manifest-plugin/dist/hooks.js"), emitCountMap = new Map(), defaults = {
118
118
  assetHookStage: 1 / 0,
119
119
  basePath: '',
120
120
  fileName: 'manifest.json',
@@ -684,5 +684,5 @@ __webpack_require__.add({
684
684
  });
685
685
  }
686
686
  });
687
- var RspackManifestPlugin = __webpack_require__("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.1.2/node_modules/rspack-manifest-plugin/dist/index.js").RspackManifestPlugin;
687
+ var RspackManifestPlugin = __webpack_require__("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.2_@rspack+core@2.1.3/node_modules/rspack-manifest-plugin/dist/index.js").RspackManifestPlugin;
688
688
  export { RspackManifestPlugin };
package/dist/memfs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { __webpack_require__ } from "./1~rslib-runtime.js";
2
- import "./756.js";
2
+ import "./711.js";
3
3
  __webpack_require__.add({
4
4
  "../../node_modules/.pnpm/@jsonjoy.com+base64@17.67.0_tslib@2.8.1/node_modules/@jsonjoy.com/base64/lib/constants.js" (__unused_rspack_module, exports) {
5
5
  exports.alphabet = void 0, exports.alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', 'function' == typeof Buffer && Buffer.from;
package/dist/sirv.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { join, normalize, resolve, sep } from "node:path";
2
2
  import { join as external_path_join, resolve as external_path_resolve } from "path";
3
3
  import { readdirSync, statSync } from "fs";
4
- import { mrmime_lookup } from "./756.js";
5
- import * as __rspack_external_node_fs_5ea92f0c from "node:fs";
6
- import * as __rspack_external_node_querystring_aeb3c0b4 from "node:querystring";
4
+ import { mrmime_lookup } from "./711.js";
5
+ import * as __rspack_external_node_fs_1b05aee1 from "node:fs";
6
+ import * as __rspack_external_node_querystring_5092a520 from "node:querystring";
7
7
  function totalist(dir, callback, pre = '') {
8
8
  let arr = readdirSync(dir = external_path_resolve('.', dir)), i = 0, abs, stats;
9
9
  for(; i < arr.length; i++)(stats = statSync(abs = external_path_join(dir, arr[i]))).isDirectory() ? totalist(abs, callback, external_path_join(pre, arr[i])) : callback(external_path_join(pre, arr[i]), abs, stats);
@@ -16,7 +16,7 @@ function parse(req) {
16
16
  let pathname = raw, search = '', query, hash;
17
17
  if (raw.length > 1) {
18
18
  let idx = raw.indexOf('#', 1);
19
- -1 !== idx && (hash = raw.substring(idx), pathname = raw.substring(0, idx)), -1 !== (idx = pathname.indexOf('?', 1)) && (search = pathname.substring(idx), pathname = pathname.substring(0, idx), search.length > 1 && (query = __rspack_external_node_querystring_aeb3c0b4.parse(search.substring(1))));
19
+ -1 !== idx && (hash = raw.substring(idx), pathname = raw.substring(0, idx)), -1 !== (idx = pathname.indexOf('?', 1)) && (search = pathname.substring(idx), pathname = pathname.substring(0, idx), search.length > 1 && (query = __rspack_external_node_querystring_5092a520.parse(search.substring(1))));
20
20
  }
21
21
  return req._parsedUrl = {
22
22
  pathname,
@@ -43,8 +43,8 @@ function viaCache(cache, uri, extns) {
43
43
  }
44
44
  function viaLocal(dir, isEtag, uri, extns) {
45
45
  let abs, stats, name, headers, i = 0, arr = toAssume(uri, extns);
46
- for(; i < arr.length; i++)if ((abs = normalize(join(dir, name = arr[i]))).startsWith(dir) && __rspack_external_node_fs_5ea92f0c.existsSync(abs)) {
47
- if ((stats = __rspack_external_node_fs_5ea92f0c.statSync(abs)).isDirectory()) continue;
46
+ for(; i < arr.length; i++)if ((abs = normalize(join(dir, name = arr[i]))).startsWith(dir) && __rspack_external_node_fs_1b05aee1.existsSync(abs)) {
47
+ if ((stats = __rspack_external_node_fs_1b05aee1.statSync(abs)).isDirectory()) continue;
48
48
  return (headers = toHeaders(name, stats, isEtag))['Cache-Control'] = isEtag ? 'no-cache' : 'no-store', {
49
49
  abs,
50
50
  stats,
@@ -66,7 +66,7 @@ function send(req, res, file, stats, headers) {
66
66
  if (end >= stats.size && (end = stats.size - 1), start >= stats.size) return res.setHeader('Content-Range', `bytes */${stats.size}`), res.statusCode = 416, res.end();
67
67
  headers['Content-Range'] = `bytes ${start}-${end}/${stats.size}`, headers['Content-Length'] = end - start + 1, headers['Accept-Ranges'] = 'bytes';
68
68
  }
69
- res.writeHead(code, headers), __rspack_external_node_fs_5ea92f0c.createReadStream(file, opts).pipe(res);
69
+ res.writeHead(code, headers), __rspack_external_node_fs_1b05aee1.createReadStream(file, opts).pipe(res);
70
70
  }
71
71
  let ENCODING = {
72
72
  '.br': 'br',
package/dist/ws.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { __webpack_require__ } from "./1~rslib-runtime.js";
2
- import "./756.js";
2
+ import "./711.js";
3
3
  __webpack_require__.add({
4
4
  "../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/buffer-util.js" (module, __unused_rspack_exports, __webpack_require__) {
5
5
  let { EMPTY_BUFFER } = __webpack_require__("../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/constants.js"), FastBuffer = Buffer[Symbol.species];
@@ -8,6 +8,7 @@ export declare const CHAIN_ID: {
8
8
  /** Rule for JSON */ readonly JSON: 'json';
9
9
  /** Rule for images */ readonly IMAGE: 'image';
10
10
  /** Rule for media */ readonly MEDIA: 'media';
11
+ /** Rule for other built-in assets */ readonly ASSETS: 'assets';
11
12
  /** Rule for additional assets */ readonly ADDITIONAL_ASSETS: 'additional-assets';
12
13
  /** Rule for JS */ readonly JS: 'js';
13
14
  /** Rule for data uri encoded javascript */ readonly JS_DATA_URI: 'js-data-uri';
@@ -58,8 +58,10 @@ export declare const PLUGIN_SWC_NAME = 'rsbuild:swc';
58
58
  export declare const PLUGIN_CSS_NAME = 'rsbuild:css';
59
59
  // Extensions
60
60
  export declare const FONT_EXTENSIONS: string[];
61
+ export declare const ASSET_EXTENSIONS: string[];
61
62
  export declare const IMAGE_EXTENSIONS: string[];
62
63
  export declare const VIDEO_EXTENSIONS: string[];
63
64
  export declare const AUDIO_EXTENSIONS: string[];
65
+ export declare const TRACK_EXTENSIONS: string[];
64
66
  export declare const LAZY_COMPILATION_IDENTIFIER = 'lazy-compilation-proxy';
65
67
  export declare const BROWSER_LOG_PREFIX = '[browser]';
@@ -543,17 +543,19 @@ export interface ResourceHintsOptions {
543
543
  /**
544
544
  * Specifies which types of resources will be included.
545
545
  * - `async-chunks`: Includes all async resources on the current page, such as async JS
546
- * chunks, and its associated CSS, images, fonts, and other static resources.
546
+ * chunks, and its associated CSS, images, and fonts.
547
547
  * - `initial`: Includes all non-async resources on the current page.
548
548
  * - `all-chunks`: Includes all async and non-async resources on the current page.
549
549
  * - `all-assets`: Includes all resources from all pages.
550
550
  * @default 'async-chunks'
551
551
  */ type?: ResourceHintsIncludeType;
552
552
  /**
553
- * A extra filter to determine which resources to include.
553
+ * An extra filter to determine which resources to include.
554
554
  */ include?: ResourceHintsFilter;
555
555
  /**
556
- * A extra filter to determine which resources to exclude.
556
+ * An extra filter to determine which resources to exclude.
557
+ *
558
+ * @default /\.(?:webmanifest|pdf|txt)$/i
557
559
  */ exclude?: ResourceHintsFilter;
558
560
  /**
559
561
  * Whether to dedupe script resources that already exist in the current HTML content.
@@ -599,7 +601,7 @@ export interface PerformanceConfig {
599
601
  *
600
602
  * When `performance.preload` is set to `true`, Rsbuild will use the following default
601
603
  * options to preload resources. This means preloading all async resources on the current
602
- * page, including async JS and its associated CSS, image, font, and other resources.
604
+ * page, including async JS and its associated CSS, image, and font resources.
603
605
  *
604
606
  * ```js
605
607
  * const defaultOptions = {
@@ -615,7 +617,7 @@ export interface PerformanceConfig {
615
617
  *
616
618
  * When `performance.prefetch` is set to `true`, Rsbuild will use the following default
617
619
  * options to prefetch resources. This means prefetching all async resources on the current
618
- * page, including async JS and its associated CSS, image, font, and other resources.
620
+ * page, including async JS and its associated CSS, image, and font resources.
619
621
  *
620
622
  * ```js
621
623
  * const defaultOptions = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/core",
3
- "version": "2.1.4",
3
+ "version": "2.1.5",
4
4
  "description": "The Rspack-based build tool.",
5
5
  "homepage": "https://rsbuild.rs",
6
6
  "bugs": {
@@ -40,13 +40,13 @@
40
40
  "registry": "https://registry.npmjs.org/"
41
41
  },
42
42
  "dependencies": {
43
- "@rspack/core": "~2.1.2",
43
+ "@rspack/core": "~2.1.3",
44
44
  "@swc/helpers": "^0.5.23"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@jridgewell/remapping": "^2.3.5",
48
48
  "@jridgewell/trace-mapping": "^0.3.31",
49
- "@rslib/core": "0.23.1",
49
+ "@rslib/core": "0.23.2",
50
50
  "@types/cors": "^2.8.19",
51
51
  "@types/node": "^24.13.2",
52
52
  "@types/on-finished": "2.3.5",
@@ -63,14 +63,14 @@
63
63
  "dotenv-expand": "^13.0.0",
64
64
  "fresh-import": "^0.2.1",
65
65
  "html-rspack-plugin": "6.1.9",
66
- "http-proxy-middleware": "4.1.1",
66
+ "http-proxy-middleware": "4.2.0",
67
67
  "jiti": "^2.7.0",
68
68
  "launch-editor-middleware": "^2.14.1",
69
69
  "memfs": "^4.57.8",
70
70
  "mrmime": "^2.0.1",
71
71
  "on-finished": "2.4.1",
72
72
  "open": "^11.0.0",
73
- "postcss": "^8.5.15",
73
+ "postcss": "^8.5.16",
74
74
  "postcss-load-config": "6.0.1",
75
75
  "postcss-loader": "8.2.1",
76
76
  "prebundle": "1.6.5",
package/types.d.ts CHANGED
@@ -152,6 +152,10 @@ declare module '*.cur' {
152
152
  const src: string;
153
153
  export default src;
154
154
  }
155
+ declare module '*.jxl' {
156
+ const src: string;
157
+ export default src;
158
+ }
155
159
 
156
160
  /**
157
161
  * Font assets
@@ -224,6 +228,26 @@ declare module '*.opus' {
224
228
  const src: string;
225
229
  export default src;
226
230
  }
231
+ declare module '*.vtt' {
232
+ const src: string;
233
+ export default src;
234
+ }
235
+
236
+ /**
237
+ * Other assets
238
+ */
239
+ declare module '*.webmanifest' {
240
+ const src: string;
241
+ export default src;
242
+ }
243
+ declare module '*.pdf' {
244
+ const src: string;
245
+ export default src;
246
+ }
247
+ declare module '*.txt' {
248
+ const src: string;
249
+ export default src;
250
+ }
227
251
 
228
252
  /**
229
253
  * @requires [@rsbuild/plugin-yaml](https://npmjs.com/package/@rsbuild/plugin-yaml)
File without changes
File without changes
File without changes