@rspack/cli 2.1.9 → 2.2.0-beta.1

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 +8 -2
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -987,11 +987,17 @@ const loadConfigByPath = async (configPath, options)=>{
987
987
  fresh: true
988
988
  });
989
989
  if (!isRspackConfig(content)) throw new Error(`[rspack-cli:loadConfig] The config at "${configPath}" must be an object or an array, got ${String(content)}`);
990
- return content;
990
+ return 'native' === options.configLoader ? content : normalizeContext(content);
991
991
  };
992
992
  const isConfigObject = (value)=>Boolean(value) && 'object' == typeof value && !Array.isArray(value);
993
993
  const isRspackConfig = (value)=>Array.isArray(value) || isConfigObject(value);
994
994
  const checkIsMultiRspackOptions = (config)=>Array.isArray(config);
995
+ const normalizeContext = (config)=>{
996
+ for (const item of checkIsMultiRspackOptions(config) ? config : [
997
+ config
998
+ ])if ('string' == typeof item.context) item.context = node_path.normalize(item.context);
999
+ return config;
1000
+ };
995
1001
  async function loadExtendedConfig(config, configPath, cwd, options, visitedPaths) {
996
1002
  const currentVisitedPaths = visitedPaths ?? new Set();
997
1003
  if (checkIsMultiRspackOptions(config)) {
@@ -1115,7 +1121,7 @@ class RspackCLI {
1115
1121
  this.colors = this.createColors();
1116
1122
  this.program = program;
1117
1123
  program.help();
1118
- program.version("2.1.9");
1124
+ program.version("2.2.0-beta.1");
1119
1125
  }
1120
1126
  wrapAction(fn) {
1121
1127
  return (...args)=>{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/cli",
3
- "version": "2.1.9",
3
+ "version": "2.2.0-beta.1",
4
4
  "description": "CLI for rspack",
5
5
  "homepage": "https://rspack.rs",
6
6
  "bugs": "https://github.com/web-infra-dev/rspack/issues",
@@ -40,10 +40,10 @@
40
40
  "jiti": "^2.7.0",
41
41
  "prebundle": "^1.6.5",
42
42
  "rspack-merge": "1.0.1",
43
- "rstack": "^0.4.0",
43
+ "rstack": "^0.6.0",
44
44
  "typescript": "^6.0.3",
45
- "@rspack/core": "2.1.9",
46
- "@rspack/test-tools": "2.1.9"
45
+ "@rspack/core": "2.2.0-beta.1",
46
+ "@rspack/test-tools": "2.2.0-beta.1"
47
47
  },
48
48
  "peerDependencies": {
49
49
  "@rspack/core": "^2.0.0-0",