@rspack/cli 2.2.6 → 2.2.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.
Files changed (2) hide show
  1. package/dist/index.js +9 -10
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -1134,7 +1134,7 @@ class RspackCLI {
1134
1134
  this.colors = this.createColors();
1135
1135
  this.program = program;
1136
1136
  program.help();
1137
- program.version("2.2.6");
1137
+ program.version("2.2.7");
1138
1138
  }
1139
1139
  wrapAction(fn) {
1140
1140
  return (...args)=>{
@@ -1144,8 +1144,11 @@ class RspackCLI {
1144
1144
  }
1145
1145
  async buildCompilerConfig(options, rspackCommand) {
1146
1146
  const { config: rawConfig, pathMap } = await this.loadConfig(options);
1147
- const config = await this.buildConfig(rawConfig, pathMap, options, rspackCommand);
1148
- return config;
1147
+ if (process.env.RSPACK_PROFILE) {
1148
+ const { applyProfile } = await import("./profile.js");
1149
+ await applyProfile(process.env.RSPACK_PROFILE, process.env.RSPACK_TRACE_LAYER, process.env.RSPACK_TRACE_OUTPUT);
1150
+ }
1151
+ return this.buildConfig(rawConfig, pathMap, options, rspackCommand);
1149
1152
  }
1150
1153
  createCompiler(config, callback) {
1151
1154
  const isWatch = Array.isArray(config) ? config.some((i)=>i.watch) : config.watch;
@@ -1210,19 +1213,15 @@ class RspackCLI {
1210
1213
  ];
1211
1214
  for (const command of builtinCommands)await command.apply(this);
1212
1215
  }
1213
- async buildConfig(item, pathMap, options, command) {
1216
+ buildConfig(item, pathMap, options, command) {
1214
1217
  const isBuild = 'build' === command;
1215
1218
  const isServe = 'serve' === command;
1216
- const internalBuildConfig = async (item)=>{
1219
+ const internalBuildConfig = (item)=>{
1217
1220
  if (options.entry) item.entry = {
1218
1221
  main: options.entry.map((x)=>node_path.resolve(process.cwd(), x))[0]
1219
1222
  };
1220
1223
  item.output = item.output || {};
1221
1224
  if (options.outputPath) item.output.path = node_path.resolve(process.cwd(), options.outputPath);
1222
- if (process.env.RSPACK_PROFILE) {
1223
- const { applyProfile } = await import("./profile.js");
1224
- await applyProfile(process.env.RSPACK_PROFILE, process.env.RSPACK_TRACE_LAYER, process.env.RSPACK_TRACE_OUTPUT);
1225
- }
1226
1225
  if (options.watch) item.watch = options.watch;
1227
1226
  if (!item.mode) item.mode = isBuild ? 'production' : 'development';
1228
1227
  if (options.mode) item.mode = options.mode;
@@ -1263,7 +1262,7 @@ class RspackCLI {
1263
1262
  else if (void 0 === item.stats.preset && true !== item.stats.all) item.stats.logging ??= false;
1264
1263
  return item;
1265
1264
  };
1266
- if (Array.isArray(item)) return Promise.all(item.map(internalBuildConfig));
1265
+ if (Array.isArray(item)) return item.map(internalBuildConfig);
1267
1266
  return internalBuildConfig(item);
1268
1267
  }
1269
1268
  async loadConfig(options) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/cli",
3
- "version": "2.2.6",
3
+ "version": "2.2.7",
4
4
  "description": "CLI for rspack",
5
5
  "homepage": "https://rspack.rs",
6
6
  "bugs": "https://github.com/web-infra-dev/rspack/issues",
@@ -31,7 +31,7 @@
31
31
  "@discoveryjs/json-ext": "^1.1.0",
32
32
  "@microsoft/api-extractor": "^7.59.1",
33
33
  "@rstackjs/load-config": "^1.0.0",
34
- "@rspack/core": "2.2.6",
34
+ "@rspack/core": "2.2.7",
35
35
  "@rspack/dev-server": "^2.2.1",
36
36
  "cac": "^7.0.0",
37
37
  "concat-stream": "^2.0.0",
@@ -40,7 +40,7 @@
40
40
  "jiti": "^2.7.0",
41
41
  "prebundle": "^1.6.5",
42
42
  "rspack-merge": "1.0.1",
43
- "rstack": "^0.7.4",
43
+ "rstack": "^0.7.6",
44
44
  "typescript": "^6.0.3"
45
45
  },
46
46
  "peerDependencies": {