slicejs-cli 2.8.1 → 2.8.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.
@@ -398,10 +398,14 @@ export default class BundleGenerator {
398
398
 
399
399
  // 2. Route bundles
400
400
  for (const [routeKey, bundle] of Object.entries(this.bundles.routes)) {
401
+ const routeIdentifier = Array.isArray(bundle.path || bundle.paths)
402
+ ? routeKey
403
+ : (bundle.path || bundle.paths || routeKey);
404
+
401
405
  const routeFile = await this.createBundleFile(
402
406
  bundle.components,
403
407
  'route',
404
- bundle.path || bundle.paths || routeKey // Use routeKey as fallback for hybrid bundles
408
+ routeIdentifier
405
409
  );
406
410
  files.push(routeFile);
407
411
  }
@@ -627,9 +631,13 @@ if (window.slice && window.slice.controller) {
627
631
  };
628
632
 
629
633
  for (const [key, bundle] of Object.entries(this.bundles.routes)) {
634
+ const routeIdentifier = Array.isArray(bundle.path || bundle.paths)
635
+ ? key
636
+ : (bundle.path || bundle.paths || key);
637
+
630
638
  config.bundles.routes[key] = {
631
639
  path: bundle.path || bundle.paths || key, // Support both single path and array of paths, fallback to key
632
- file: `slice-bundle.${this.routeToFileName(bundle.path || bundle.paths || key)}.js`,
640
+ file: `slice-bundle.${this.routeToFileName(routeIdentifier)}.js`,
633
641
  size: bundle.size,
634
642
  components: bundle.components.map(c => c.name),
635
643
  dependencies: ['critical']
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "slicejs-cli",
3
- "version": "2.8.1",
3
+ "version": "2.8.2",
4
4
  "description": "Command client for developing web applications with Slice.js framework",
5
5
  "main": "client.js",
6
6
  "bin": {