@rslib/core 0.12.2 → 0.12.3

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
@@ -312,6 +312,7 @@ const pluginLibCss = (rootDir, auto, banner, footer)=>({
312
312
  CHAIN_ID.RULE.LESS,
313
313
  CHAIN_ID.RULE.STYLUS
314
314
  ]){
315
+ if (!config.module.rules.has(ruleId)) continue;
315
316
  const rule = config.module.rule(ruleId);
316
317
  if (rule.uses.has(CHAIN_ID.USE.MINI_CSS_EXTRACT)) {
317
318
  isUsingCssExtract = true;
@@ -1588,6 +1589,23 @@ function composeDecoratorsConfig(compilerOptions, version) {
1588
1589
  }
1589
1590
  };
1590
1591
  }
1592
+ function composePrintFileSizeConfig(bundle, target) {
1593
+ if (bundle) return {};
1594
+ return {
1595
+ performance: {
1596
+ printFileSize: {
1597
+ total: ({ environmentName, distPath, assets, totalSize, totalGzipSize })=>{
1598
+ let log = `${picocolors.yellow(assets.length)} files generated in ${picocolors.blue(distPath)} ${picocolors.dim(`(${environmentName})`)}`;
1599
+ log += '\n';
1600
+ log += `${picocolors.magenta('Total size:')} ${(totalSize / 1000).toFixed(1)} kB`;
1601
+ if ('web' === target) log += ` ${picocolors.green(`(${(totalGzipSize / 1000).toFixed(1)} kB gzipped)`)}`;
1602
+ return log;
1603
+ },
1604
+ detail: false
1605
+ }
1606
+ }
1607
+ };
1608
+ }
1591
1609
  async function createConstantRsbuildConfig() {
1592
1610
  return (0, __WEBPACK_EXTERNAL_MODULE__rsbuild_core_1b356efc__.defineConfig)({
1593
1611
  performance: {
@@ -2304,7 +2322,8 @@ async function composeLibRsbuildConfig(config, root, sharedPlugins) {
2304
2322
  const minifyConfig = composeMinifyConfig(config);
2305
2323
  const bannerFooterConfig = composeBannerFooterConfig(banner, footer);
2306
2324
  const decoratorsConfig = composeDecoratorsConfig(compilerOptions, config.source?.decorators?.version);
2307
- return (0, __WEBPACK_EXTERNAL_MODULE__rsbuild_core_1b356efc__.mergeRsbuildConfig)(formatConfig, shimsConfig, syntaxConfig, externalHelpersConfig, autoExtensionConfig, targetConfig, externalsWarnConfig, userExternalsConfig, autoExternalConfig, targetExternalsConfig, bundlelessExternalConfig, entryConfig, cssConfig, assetConfig, entryChunkConfig, minifyConfig, dtsConfig, bannerFooterConfig, decoratorsConfig);
2325
+ const printFileSizeConfig = composePrintFileSizeConfig(bundle, target);
2326
+ return (0, __WEBPACK_EXTERNAL_MODULE__rsbuild_core_1b356efc__.mergeRsbuildConfig)(formatConfig, shimsConfig, syntaxConfig, externalHelpersConfig, autoExtensionConfig, targetConfig, externalsWarnConfig, userExternalsConfig, autoExternalConfig, targetExternalsConfig, bundlelessExternalConfig, entryConfig, cssConfig, assetConfig, entryChunkConfig, minifyConfig, dtsConfig, bannerFooterConfig, decoratorsConfig, printFileSizeConfig);
2308
2327
  }
2309
2328
  async function composeCreateRsbuildConfig(rslibConfig) {
2310
2329
  const constantRsbuildConfig = await createConstantRsbuildConfig();
@@ -3012,7 +3031,7 @@ const applyCommonOptions = (cli)=>{
3012
3031
  function runCli() {
3013
3032
  const cli = dist('rslib');
3014
3033
  cli.help();
3015
- cli.version("0.12.2");
3034
+ cli.version("0.12.3");
3016
3035
  applyCommonOptions(cli);
3017
3036
  const buildCommand = cli.command('build', 'build the library for production');
3018
3037
  const inspectCommand = cli.command('inspect', 'inspect the Rsbuild / Rspack configs of Rslib projects');
@@ -3083,8 +3102,8 @@ function prepareCli() {
3083
3102
  initNodeEnv();
3084
3103
  const { npm_execpath } = process.env;
3085
3104
  if (!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) console.log();
3086
- logger.greet(` Rslib v0.12.2\n`);
3105
+ logger.greet(` Rslib v0.12.3\n`);
3087
3106
  }
3088
- const src_version = "0.12.2";
3107
+ const src_version = "0.12.3";
3089
3108
  var __webpack_exports__rspack = __WEBPACK_EXTERNAL_MODULE__rsbuild_core_1b356efc__.rspack;
3090
3109
  export { build, defineConfig, inspect, loadConfig, logger, prepareCli, __WEBPACK_EXTERNAL_MODULE__rsbuild_core_1b356efc__ as rsbuild, runCli, startMFDevServer, composeCreateRsbuildConfig as unstable_composeCreateRsbuildConfig, src_version as version, __webpack_exports__rspack as rspack };
@@ -1,5 +1,5 @@
1
1
  import { type EnvironmentConfig, type RsbuildEntry } from '@rsbuild/core';
2
- import type { AutoExternal, BannerAndFooter, Format, LibConfig, PkgJson, RequireKey, RsbuildConfigEntry, RsbuildConfigWithLibInfo, RslibConfig, RslibConfigAsyncFn, RslibConfigExport, RslibConfigSyncFn } from './types';
2
+ import type { AutoExternal, BannerAndFooter, Format, LibConfig, PkgJson, RequireKey, RsbuildConfigEntry, RsbuildConfigOutputTarget, RsbuildConfigWithLibInfo, RslibConfig, RslibConfigAsyncFn, RslibConfigExport, RslibConfigSyncFn } from './types';
3
3
  /**
4
4
  * This function helps you to autocomplete configuration types.
5
5
  * It accepts a Rslib config object, or a function that returns a config.
@@ -26,6 +26,7 @@ export declare const composeAutoExternalConfig: (options: {
26
26
  export declare function composeMinifyConfig(config: LibConfig): EnvironmentConfig;
27
27
  export declare function composeBannerFooterConfig(banner: BannerAndFooter, footer: BannerAndFooter): EnvironmentConfig;
28
28
  export declare function composeDecoratorsConfig(compilerOptions?: Record<string, any>, version?: NonNullable<NonNullable<EnvironmentConfig['source']>['decorators']>['version']): EnvironmentConfig;
29
+ export declare function composePrintFileSizeConfig(bundle: LibConfig['bundle'], target: RsbuildConfigOutputTarget): EnvironmentConfig;
29
30
  export declare function createConstantRsbuildConfig(): Promise<EnvironmentConfig>;
30
31
  export declare const composeModuleImportWarn: (request: string, issuer: string) => string;
31
32
  export declare const resolveEntryPath: (entries: RsbuildConfigEntry, root: string) => RsbuildEntry;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rslib/core",
3
- "version": "0.12.2",
3
+ "version": "0.12.3",
4
4
  "description": "The Rsbuild-based library development tool.",
5
5
  "homepage": "https://rslib.rs",
6
6
  "bugs": {
@@ -36,21 +36,21 @@
36
36
  "types.d.ts"
37
37
  ],
38
38
  "dependencies": {
39
- "@rsbuild/core": "1.5.0-beta.4",
39
+ "@rsbuild/core": "~1.5.0",
40
40
  "tinyglobby": "^0.2.14",
41
- "rsbuild-plugin-dts": "0.12.2"
41
+ "rsbuild-plugin-dts": "0.12.3"
42
42
  },
43
43
  "devDependencies": {
44
- "@module-federation/rsbuild-plugin": "^0.18.2",
44
+ "@module-federation/rsbuild-plugin": "^0.18.3",
45
45
  "@types/fs-extra": "^11.0.4",
46
46
  "cac": "^6.7.14",
47
47
  "chokidar": "^4.0.3",
48
48
  "fs-extra": "^11.3.1",
49
- "memfs": "^4.36.0",
49
+ "memfs": "^4.38.1",
50
50
  "picocolors": "1.1.1",
51
51
  "prebundle": "1.4.1",
52
52
  "rsbuild-plugin-publint": "^0.3.3",
53
- "rslib": "npm:@rslib/core@0.12.1",
53
+ "rslib": "npm:@rslib/core@0.12.2",
54
54
  "rslog": "^1.2.11",
55
55
  "tsconfck": "3.1.6",
56
56
  "typescript": "^5.9.2",