@rsbuild/core 0.4.11 → 0.4.12

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.
@@ -39,7 +39,7 @@ const applyServerOptions = (command) => {
39
39
  command.option("-o --open [url]", "open the page in browser on startup").option("--port <port>", "specify a port number for server to listen").option("--host <host>", "specify the host that the server listens to");
40
40
  };
41
41
  function runCli() {
42
- import_commander.program.name("rsbuild").usage("<command> [options]").version("0.4.11");
42
+ import_commander.program.name("rsbuild").usage("<command> [options]").version("0.4.12");
43
43
  const devCommand = import_commander.program.command("dev");
44
44
  const buildCommand = import_commander.program.command("build");
45
45
  const previewCommand = import_commander.program.command("preview");
@@ -34,7 +34,7 @@ function prepareCli() {
34
34
  if (!npm_execpath || npm_execpath.includes("npx-cli.js")) {
35
35
  console.log();
36
36
  }
37
- import_rslog.logger.greet(` ${`Rsbuild v${"0.4.11"}`}
37
+ import_rslog.logger.greet(` ${`Rsbuild v${"0.4.12"}`}
38
38
  `);
39
39
  }
40
40
  // Annotate the CommonJS export names for ESM import in node:
package/dist/index.js CHANGED
@@ -38,7 +38,7 @@ var import_config = require("./config");
38
38
  var import_shared = require("@rsbuild/shared");
39
39
  var import_mergeConfig = require("./mergeConfig");
40
40
  var import_constants = require("./constants");
41
- const version = "0.4.11";
41
+ const version = "0.4.12";
42
42
  // Annotate the CommonJS export names for ESM import in node:
43
43
  0 && (module.exports = {
44
44
  PLUGIN_CSS_NAME,
@@ -61,6 +61,18 @@ const calcFileSize = (len) => {
61
61
  const val = len / 1e3;
62
62
  return `${val.toFixed(val < 1 ? 2 : 1)} kB`;
63
63
  };
64
+ const coloringAssetName = (assetName) => {
65
+ if (import_shared.JS_REGEX.test(assetName)) {
66
+ return import_shared2.color.cyan(assetName);
67
+ }
68
+ if (import_shared.CSS_REGEX.test(assetName)) {
69
+ return import_shared2.color.yellow(assetName);
70
+ }
71
+ if (import_shared.HTML_REGEX.test(assetName)) {
72
+ return import_shared2.color.green(assetName);
73
+ }
74
+ return import_shared2.color.magenta(assetName);
75
+ };
64
76
  async function printFileSizes(config, stats, distPath) {
65
77
  if (config.detail === false && config.total === false) {
66
78
  return;
@@ -123,7 +135,7 @@ async function printFileSizes(config, stats, distPath) {
123
135
  const rightPadding = " ".repeat(longestLabelLength - sizeLength);
124
136
  sizeLabel += rightPadding;
125
137
  }
126
- let fileNameLabel = import_shared2.color.dim(asset.folder + import_node_path.default.sep) + import_shared2.color.cyan(asset.name);
138
+ let fileNameLabel = import_shared2.color.dim(asset.folder + import_node_path.default.sep) + coloringAssetName(asset.name);
127
139
  if (fileNameLength < longestFileLength) {
128
140
  const rightPadding = " ".repeat(longestFileLength - fileNameLength);
129
141
  fileNameLabel += rightPadding;
@@ -44,7 +44,7 @@ async function createContextByConfig(options, bundlerType, config = {}) {
44
44
  const context = {
45
45
  entry: (0, import_entry.getEntryObject)(config, "web"),
46
46
  targets: config.output?.targets || [],
47
- version: "0.4.11",
47
+ version: "0.4.12",
48
48
  rootPath,
49
49
  distPath,
50
50
  cachePath,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/core",
3
- "version": "0.4.11",
3
+ "version": "0.4.12",
4
4
  "description": "The Rspack-based build tool.",
5
5
  "homepage": "https://rsbuild.dev",
6
6
  "bugs": {
@@ -57,7 +57,7 @@
57
57
  "core-js": "~3.32.2",
58
58
  "html-webpack-plugin": "npm:html-rspack-plugin@5.6.1",
59
59
  "postcss": "^8.4.33",
60
- "@rsbuild/shared": "0.4.11"
60
+ "@rsbuild/shared": "0.4.12"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@types/node": "16.x",