vite-plugin-html-elements 0.1.2 β†’ 0.1.3

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 +5 -7
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -62,22 +62,20 @@ function getRoutesEntries(routes, srcDir, debug) {
62
62
  console.error(`❌ Route source not found: ${route.source} for path ${route.path}`);
63
63
  return;
64
64
  }
65
+ // Normalize path: remove trailing slash (except for root)
66
+ const normalizedPath = route.path === '/' ? '/' : route.path.replace(/\/$/, '');
65
67
  // Convert route path to entry name
66
- // '/' -> 'index'
67
- // '/blog' -> 'blog/index'
68
- // '/blog/today-is-nice' -> 'blog/today-is-nice/index'
69
68
  let entryName;
70
- if (route.path === '/') {
69
+ if (normalizedPath === '/') {
71
70
  entryName = 'index';
72
71
  }
73
72
  else {
74
- // Remove leading slash and add /index for directory structure
75
- const cleanPath = route.path.replace(/^\//, '');
73
+ const cleanPath = normalizedPath.replace(/^\//, '');
76
74
  entryName = `${cleanPath}/index`;
77
75
  }
78
76
  entries[entryName] = sourcePath;
79
77
  if (debug) {
80
- console.log(`πŸ—ΊοΈ Route: ${route.path} -> ${route.source} (output: ${entryName}.html)`);
78
+ console.log(`πŸ—ΊοΈ Route: ${normalizedPath} -> ${route.source} (output: ${entryName}.html)`);
81
79
  }
82
80
  });
83
81
  return entries;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-html-elements",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Modular HTML without the JavaScript",
5
5
  "author": "Vincent Medina",
6
6
  "license": "MIT",