@rspack/cli 1.6.0 → 1.6.2

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/0~361.js CHANGED
@@ -14,7 +14,7 @@ exports.modules = {
14
14
  var _rspackCore__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./src/utils/rspackCore.ts");
15
15
  const DEFAULT_RUST_TRACE_LAYER = "perfetto";
16
16
  async function applyProfile(filterValue, traceLayer = DEFAULT_RUST_TRACE_LAYER, traceOutput) {
17
- const { asyncExitHook } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "exit-hook"));
17
+ const { asyncExitHook } = await import("exit-hook");
18
18
  if ("logger" !== traceLayer && "perfetto" !== traceLayer) throw new Error(`unsupported trace layer: ${traceLayer}`);
19
19
  const timestamp = Date.now();
20
20
  const defaultOutputDir = node_path__WEBPACK_IMPORTED_MODULE_1___default().resolve(`.rspack-profile-${timestamp}-${process.pid}`);
package/dist/index.js CHANGED
@@ -153,30 +153,6 @@ var __webpack_modules__ = {
153
153
  path: function(module) {
154
154
  "use strict";
155
155
  module.exports = require("path");
156
- },
157
- "@discoveryjs/json-ext": function(module) {
158
- "use strict";
159
- module.exports = import("@discoveryjs/json-ext").then(function(module) {
160
- return module;
161
- });
162
- },
163
- "@rspack/dev-server": function(module) {
164
- "use strict";
165
- module.exports = import("@rspack/dev-server").then(function(module) {
166
- return module;
167
- });
168
- },
169
- "exit-hook": function(module) {
170
- "use strict";
171
- module.exports = import("exit-hook").then(function(module) {
172
- return module;
173
- });
174
- },
175
- "webpack-bundle-analyzer": function(module) {
176
- "use strict";
177
- module.exports = import("webpack-bundle-analyzer").then(function(module) {
178
- return module;
179
- });
180
156
  }
181
157
  };
182
158
  var __webpack_module_cache__ = {};
@@ -259,9 +235,9 @@ var __webpack_exports__ = {};
259
235
  "use strict";
260
236
  __webpack_require__.r(__webpack_exports__);
261
237
  __webpack_require__.d(__webpack_exports__, {
262
- defineConfig: ()=>defineConfig,
263
238
  definePlugin: ()=>definePlugin,
264
- RspackCLI: ()=>RspackCLI
239
+ RspackCLI: ()=>RspackCLI,
240
+ defineConfig: ()=>defineConfig
265
241
  });
266
242
  var external_node_path_ = __webpack_require__("node:path");
267
243
  var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_);
@@ -837,7 +813,7 @@ ${section.body}` : section.body).join("\n\n"));
837
813
  const logger = cli.getLogger();
838
814
  let createJsonStringifyStream;
839
815
  if (options.json) {
840
- const jsonExt = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "@discoveryjs/json-ext"));
816
+ const jsonExt = await import("@discoveryjs/json-ext");
841
817
  createJsonStringifyStream = jsonExt.default.stringifyStream;
842
818
  }
843
819
  const errorHandler = (error, stats)=>{
@@ -894,7 +870,7 @@ ${section.body}` : section.body).join("\n\n"));
894
870
  command.action(async (dir, options)=>{
895
871
  setDefaultNodeEnv(options, "production");
896
872
  normalizeCommonOptions(options, "preview");
897
- const { RspackDevServer } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "@rspack/dev-server"));
873
+ const { RspackDevServer } = await import("@rspack/dev-server");
898
874
  let { config } = await cli.loadConfig(options);
899
875
  config = await getPreviewConfig(config, options, dir);
900
876
  if (!Array.isArray(config)) config = [
@@ -950,7 +926,7 @@ ${section.body}` : section.body).join("\n\n"));
950
926
  setDefaultNodeEnv(options, "development");
951
927
  normalizeCommonOptions(options, "serve");
952
928
  options.hot = normalizeHotOption(options.hot);
953
- const { RspackDevServer } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "@rspack/dev-server"));
929
+ const { RspackDevServer } = await import("@rspack/dev-server");
954
930
  const compiler = await cli.createCompiler(options, "serve");
955
931
  if (!compiler) return;
956
932
  const compilers = cli.isMultipleCompiler(compiler) ? compiler.compilers : [
@@ -1067,11 +1043,11 @@ ${section.body}` : section.body).join("\n\n"));
1067
1043
  ".cts",
1068
1044
  ".mts"
1069
1045
  ];
1070
- const isTsFile_isTsFile = (configPath)=>{
1046
+ const isTsFile = (configPath)=>{
1071
1047
  const ext = external_node_path_default().extname(configPath);
1072
1048
  return TS_EXTENSION.includes(ext);
1073
1049
  };
1074
- const isTsFile = isTsFile_isTsFile;
1050
+ const utils_isTsFile = isTsFile;
1075
1051
  const injectInlineSourceMap = ({ code, map })=>{
1076
1052
  if (map) {
1077
1053
  const base64Map = Buffer.from(map, "utf8").toString("base64");
@@ -1104,8 +1080,8 @@ ${section.body}` : section.body).join("\n\n"));
1104
1080
  }
1105
1081
  const loadConfig_DEFAULT_CONFIG_NAME = "rspack.config";
1106
1082
  const registerLoader = (configPath)=>{
1107
- if (isEsmFile(configPath) && isTsFile(configPath)) return;
1108
- if (!isTsFile(configPath)) throw new Error(`config file "${configPath}" is not supported.`);
1083
+ if (isEsmFile(configPath) && utils_isTsFile(configPath)) return;
1084
+ if (!utils_isTsFile(configPath)) throw new Error(`config file "${configPath}" is not supported.`);
1109
1085
  (0, lib.addHook)((code, filename)=>{
1110
1086
  try {
1111
1087
  return compile(code, filename);
@@ -1168,7 +1144,7 @@ ${section.body}` : section.body).join("\n\n"));
1168
1144
  throw new Error(`Cannot find module '${extendPath}' to extend from.`);
1169
1145
  }
1170
1146
  if (!external_node_fs_default().existsSync(resolvedPath)) throw new Error(`Extended configuration file "${resolvedPath}" not found.`);
1171
- if (isTsFile(resolvedPath) && "register" === options.configLoader) registerLoader(resolvedPath);
1147
+ if (utils_isTsFile(resolvedPath) && "register" === options.configLoader) registerLoader(resolvedPath);
1172
1148
  let loadedConfig = await crossImport(resolvedPath);
1173
1149
  if ("function" == typeof loadedConfig) {
1174
1150
  loadedConfig = loadedConfig(options.env, options);
@@ -1197,7 +1173,7 @@ ${section.body}` : section.body).join("\n\n"));
1197
1173
  if (!defaultConfig) return null;
1198
1174
  configPath = defaultConfig;
1199
1175
  }
1200
- if (isTsFile(configPath) && "register" === options.configLoader) registerLoader(configPath);
1176
+ if (utils_isTsFile(configPath) && "register" === options.configLoader) registerLoader(configPath);
1201
1177
  const loadedConfig = await crossImport(configPath);
1202
1178
  return {
1203
1179
  loadedConfig,
@@ -1212,7 +1188,7 @@ ${section.body}` : section.body).join("\n\n"));
1212
1188
  this.colors = this.createColors();
1213
1189
  this.program = program;
1214
1190
  program.help();
1215
- program.version("1.6.0");
1191
+ program.version("1.6.2");
1216
1192
  }
1217
1193
  async createCompiler(options, rspackCommand, callback) {
1218
1194
  let { config, pathMap } = await this.loadConfig(options);
@@ -1274,7 +1250,7 @@ ${section.body}` : section.body).join("\n\n"));
1274
1250
  item.output = item.output || {};
1275
1251
  if (options.outputPath) item.output.path = external_node_path_default().resolve(process.cwd(), options.outputPath);
1276
1252
  if (options.analyze) {
1277
- const { BundleAnalyzerPlugin } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "webpack-bundle-analyzer"));
1253
+ const { BundleAnalyzerPlugin } = await import("webpack-bundle-analyzer");
1278
1254
  (item.plugins ??= []).push({
1279
1255
  name: "rspack-bundle-analyzer",
1280
1256
  apply (compiler) {
package/dist/index.mjs CHANGED
@@ -1030,11 +1030,11 @@ const TS_EXTENSION = [
1030
1030
  ".cts",
1031
1031
  ".mts"
1032
1032
  ];
1033
- const isTsFile_isTsFile = (configPath)=>{
1033
+ const isTsFile = (configPath)=>{
1034
1034
  const ext = external_node_path_["default"].extname(configPath);
1035
1035
  return TS_EXTENSION.includes(ext);
1036
1036
  };
1037
- const isTsFile = isTsFile_isTsFile;
1037
+ const utils_isTsFile = isTsFile;
1038
1038
  const injectInlineSourceMap = ({ code, map })=>{
1039
1039
  if (map) {
1040
1040
  const base64Map = Buffer.from(map, "utf8").toString("base64");
@@ -1067,8 +1067,8 @@ function compile(sourcecode, filename) {
1067
1067
  }
1068
1068
  const loadConfig_DEFAULT_CONFIG_NAME = "rspack.config";
1069
1069
  const registerLoader = (configPath)=>{
1070
- if (isEsmFile(configPath) && isTsFile(configPath)) return;
1071
- if (!isTsFile(configPath)) throw new Error(`config file "${configPath}" is not supported.`);
1070
+ if (isEsmFile(configPath) && utils_isTsFile(configPath)) return;
1071
+ if (!utils_isTsFile(configPath)) throw new Error(`config file "${configPath}" is not supported.`);
1072
1072
  (0, lib.addHook)((code, filename)=>{
1073
1073
  try {
1074
1074
  return compile(code, filename);
@@ -1131,7 +1131,7 @@ async function loadExtendedConfig(config, configPath, cwd, options) {
1131
1131
  throw new Error(`Cannot find module '${extendPath}' to extend from.`);
1132
1132
  }
1133
1133
  if (!external_node_fs_["default"].existsSync(resolvedPath)) throw new Error(`Extended configuration file "${resolvedPath}" not found.`);
1134
- if (isTsFile(resolvedPath) && "register" === options.configLoader) registerLoader(resolvedPath);
1134
+ if (utils_isTsFile(resolvedPath) && "register" === options.configLoader) registerLoader(resolvedPath);
1135
1135
  let loadedConfig = await crossImport(resolvedPath);
1136
1136
  if ("function" == typeof loadedConfig) {
1137
1137
  loadedConfig = loadedConfig(options.env, options);
@@ -1160,7 +1160,7 @@ async function loadRspackConfig(options, cwd = process.cwd()) {
1160
1160
  if (!defaultConfig) return null;
1161
1161
  configPath = defaultConfig;
1162
1162
  }
1163
- if (isTsFile(configPath) && "register" === options.configLoader) registerLoader(configPath);
1163
+ if (utils_isTsFile(configPath) && "register" === options.configLoader) registerLoader(configPath);
1164
1164
  const loadedConfig = await crossImport(configPath);
1165
1165
  return {
1166
1166
  loadedConfig,
@@ -1175,7 +1175,7 @@ class RspackCLI {
1175
1175
  this.colors = this.createColors();
1176
1176
  this.program = program;
1177
1177
  program.help();
1178
- program.version("1.6.0");
1178
+ program.version("1.6.2");
1179
1179
  }
1180
1180
  async createCompiler(options, rspackCommand, callback) {
1181
1181
  let { config, pathMap } = await this.loadConfig(options);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/cli",
3
- "version": "1.6.0",
3
+ "version": "1.6.2",
4
4
  "description": "CLI for rspack",
5
5
  "homepage": "https://rspack.rs",
6
6
  "bugs": "https://github.com/web-infra-dev/rspack/issues",
@@ -34,7 +34,7 @@
34
34
  "webpack-bundle-analyzer": "4.10.2"
35
35
  },
36
36
  "devDependencies": {
37
- "@rslib/core": "0.16.1",
37
+ "@rslib/core": "0.17.1",
38
38
  "@types/webpack-bundle-analyzer": "^4.7.0",
39
39
  "cac": "^6.7.14",
40
40
  "concat-stream": "^2.0.0",
@@ -44,8 +44,8 @@
44
44
  "pirates": "^4.0.7",
45
45
  "ts-node": "^10.9.2",
46
46
  "typescript": "^5.9.3",
47
- "@rspack/test-tools": "1.6.0",
48
- "@rspack/core": "1.6.0"
47
+ "@rspack/core": "1.6.2",
48
+ "@rspack/test-tools": "1.6.2"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "@rspack/core": "^1.0.0-alpha || ^1.x"