@rslib/core 0.5.3 → 0.5.4

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/index.js CHANGED
@@ -160,7 +160,7 @@ function prepareCli() {
160
160
  initNodeEnv();
161
161
  const { npm_execpath } = process.env;
162
162
  if (!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) console.log();
163
- __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger.greet(` Rslib v0.5.3\n`);
163
+ __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger.greet(` Rslib v0.5.4\n`);
164
164
  }
165
165
  const DEFAULT_CONFIG_NAME = 'rslib.config';
166
166
  const DEFAULT_CONFIG_EXTENSIONS = [
@@ -1885,10 +1885,16 @@ const composeAutoExtensionConfig = (config, autoExtension, pkgJson)=>{
1885
1885
  pkgJson,
1886
1886
  autoExtension
1887
1887
  });
1888
+ const filenameHash = config.output?.filenameHash ?? false;
1889
+ const getHash = ()=>{
1890
+ if ('string' == typeof filenameHash) return filenameHash ? `.[${filenameHash}]` : '';
1891
+ return filenameHash ? '.[contenthash:8]' : '';
1892
+ };
1893
+ const hash = getHash();
1888
1894
  const updatedConfig = {
1889
1895
  output: {
1890
1896
  filename: {
1891
- js: `[name]${jsExtension}`,
1897
+ js: `[name]${hash}${jsExtension}`,
1892
1898
  ...config.output?.filename
1893
1899
  }
1894
1900
  }
@@ -2238,7 +2244,7 @@ async function composeLibRsbuildConfig(config, root, sharedPlugins) {
2238
2244
  async function composeCreateRsbuildConfig(rslibConfig) {
2239
2245
  const constantRsbuildConfig = await createConstantRsbuildConfig();
2240
2246
  const { lib: libConfigsArray, mode, root, plugins: sharedPlugins, dev, server, ...sharedRsbuildConfig } = rslibConfig;
2241
- if (!libConfigsArray) throw new Error(`Expect lib field to be an array, but got ${libConfigsArray}.`);
2247
+ if (!Array.isArray(libConfigsArray) || 0 === libConfigsArray.length) throw new Error(`Expect "lib" field to be a non-empty array, but got: ${__WEBPACK_EXTERNAL_MODULE__compiled_picocolors_index_js_ea7a20e9__["default"].cyan(JSON.stringify(libConfigsArray))}.`);
2242
2248
  const libConfigPromises = libConfigsArray.map(async (libConfig)=>{
2243
2249
  const userConfig = (0, __WEBPACK_EXTERNAL_MODULE__rsbuild_core_1b356efc__.mergeRsbuildConfig)(sharedRsbuildConfig, libConfig);
2244
2250
  const libRsbuildConfig = await composeLibRsbuildConfig(userConfig, root, sharedPlugins);
@@ -2449,7 +2455,7 @@ const repeatableOption = (value, previous)=>(previous ?? []).concat([
2449
2455
  value
2450
2456
  ]);
2451
2457
  function runCli() {
2452
- __WEBPACK_EXTERNAL_MODULE__compiled_commander_index_js_bca3ceaa__.program.name('rslib').usage('<command> [options]').version("0.5.3");
2458
+ __WEBPACK_EXTERNAL_MODULE__compiled_commander_index_js_bca3ceaa__.program.name('rslib').usage('<command> [options]').version("0.5.4");
2453
2459
  const buildCommand = __WEBPACK_EXTERNAL_MODULE__compiled_commander_index_js_bca3ceaa__.program.command('build');
2454
2460
  const inspectCommand = __WEBPACK_EXTERNAL_MODULE__compiled_commander_index_js_bca3ceaa__.program.command('inspect');
2455
2461
  const mfDevCommand = __WEBPACK_EXTERNAL_MODULE__compiled_commander_index_js_bca3ceaa__.program.command('mf-dev');
@@ -2510,6 +2516,6 @@ function runCli() {
2510
2516
  });
2511
2517
  __WEBPACK_EXTERNAL_MODULE__compiled_commander_index_js_bca3ceaa__.program.parse();
2512
2518
  }
2513
- const src_rslib_entry_version = "0.5.3";
2519
+ const src_rslib_entry_version = "0.5.4";
2514
2520
  var __webpack_exports__logger = __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger;
2515
2521
  export { build, defineConfig, inspect, loadConfig, prepareCli, runCli, startMFDevServer, composeCreateRsbuildConfig as unstable_composeCreateRsbuildConfig, src_rslib_entry_version as version, __webpack_exports__logger as logger };
@@ -16,31 +16,31 @@ export type RsbuildConfigOutputTarget = NonNullable<EnvironmentConfig['output']>
16
16
  export type Syntax = EcmaScriptVersion | string[];
17
17
  export type Dts = {
18
18
  /**
19
- * Whether to bundle the DTS files.
19
+ * Whether to bundle the declaration files.
20
20
  * @defaultValue `false`
21
21
  * @see {@link https://lib.rsbuild.dev/config/lib/dts#dtsbundle}
22
22
  */
23
23
  bundle?: boolean;
24
24
  /**
25
- * The output directory of DTS files.
25
+ * The output directory of declaration files.
26
26
  * @defaultValue {@link https://lib.rsbuild.dev/config/lib/dts#default-value}
27
27
  * @see {@link https://lib.rsbuild.dev/config/lib/dts#dtsdistpath}
28
28
  */
29
29
  distPath?: string;
30
30
  /**
31
- * Whether to generate DTS files with building the project references.
31
+ * Whether to generate declaration files with building the project references.
32
32
  * @defaultValue `false`
33
33
  * @see {@link https://lib.rsbuild.dev/config/lib/dts#dtsbuild}
34
34
  */
35
35
  build?: boolean;
36
36
  /**
37
- * Whether to abort the build process when an error occurs during DTS generation.
37
+ * Whether to abort the build process when an error occurs during declaration files generation.
38
38
  * @defaultValue `true`
39
39
  * @see {@link https://lib.rsbuild.dev/config/lib/dts#dtsabortonerror}
40
40
  */
41
41
  abortOnError?: boolean;
42
42
  /**
43
- * Whether to automatically set the DTS file extension based on the {@link format} option.
43
+ * Whether to automatically set the declaration file extension based on the {@link format} option.
44
44
  * @defaultValue `false`
45
45
  * @see {@link https://lib.rsbuild.dev/config/lib/dts#dtsautoextension}
46
46
  */
@@ -211,13 +211,13 @@ export interface LibConfig extends EnvironmentConfig {
211
211
  */
212
212
  externalHelpers?: boolean;
213
213
  /**
214
- * Inject content into the top of each JavaScript, CSS or DTS file.
214
+ * Inject content into the top of each JavaScript, CSS or declaration file.
215
215
  * @defaultValue `{}`
216
216
  * @see {@link https://lib.rsbuild.dev/config/lib/banner}
217
217
  */
218
218
  banner?: BannerAndFooter;
219
219
  /**
220
- * Inject content into the bottom of each JavaScript, CSS or DTS file.
220
+ * Inject content into the bottom of each JavaScript, CSS or declaration file.
221
221
  * @defaultValue `{}`
222
222
  * @see {@link https://lib.rsbuild.dev/config/lib/footer}
223
223
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rslib/core",
3
- "version": "0.5.3",
3
+ "version": "0.5.4",
4
4
  "description": "The Rsbuild-based library development tool.",
5
5
  "homepage": "https://lib.rsbuild.dev",
6
6
  "bugs": {
@@ -36,12 +36,12 @@
36
36
  "types.d.ts"
37
37
  ],
38
38
  "dependencies": {
39
- "@rsbuild/core": "~1.2.13",
39
+ "@rsbuild/core": "~1.2.16",
40
40
  "tinyglobby": "^0.2.12",
41
- "rsbuild-plugin-dts": "0.5.3"
41
+ "rsbuild-plugin-dts": "0.5.4"
42
42
  },
43
43
  "devDependencies": {
44
- "@module-federation/rsbuild-plugin": "^0.9.1",
44
+ "@module-federation/rsbuild-plugin": "^0.10.0",
45
45
  "@types/fs-extra": "^11.0.4",
46
46
  "chokidar": "^4.0.3",
47
47
  "commander": "^13.1.0",
@@ -50,7 +50,7 @@
50
50
  "picocolors": "1.1.1",
51
51
  "prebundle": "1.2.7",
52
52
  "rsbuild-plugin-publint": "^0.3.0",
53
- "rslib": "npm:@rslib/core@0.5.2",
53
+ "rslib": "npm:@rslib/core@0.5.3",
54
54
  "rslog": "^1.2.3",
55
55
  "tsconfck": "3.1.5",
56
56
  "typescript": "^5.8.2",