hyperspan 1.0.6 → 1.0.8

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/package.json +1 -1
  2. package/src/server.ts +6 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hyperspan",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "Hyperspan CLI - for @hyperspan/framework",
5
5
  "type": "module",
6
6
  "public": true,
package/src/server.ts CHANGED
@@ -131,7 +131,7 @@ export async function addDirectoryAsRoutes(
131
131
  plugins: [tailwind],
132
132
  entrypoints: [filePath],
133
133
  outdir: buildDir,
134
- naming: `${relativeAppPath}/${path.endsWith('/') ? path + 'index' : path}-[hash].[ext]`,
134
+ naming: `${relativeAppPath}/${filePath.split('/').pop()}-[hash].[ext]`,
135
135
  minify: IS_PROD,
136
136
  format: 'esm',
137
137
  target: 'node',
@@ -140,8 +140,11 @@ export async function addDirectoryAsRoutes(
140
140
  // Move CSS files to the public directory
141
141
  for (const output of buildResult.outputs) {
142
142
  if (output.path.endsWith('.css')) {
143
- const cssFileName = output.path.split('/').pop()!;
144
- await Bun.write(join(cssPublicDir, cssFileName), Bun.file(output.path));
143
+ const contentHash = output.hash;
144
+ const cssFileName = `${contentHash}.css`;
145
+ const cssOutputFile = Bun.file(output.path);
146
+ await Bun.write(join(cssPublicDir, cssFileName), cssOutputFile);
147
+ cssOutputFile.delete();
145
148
  cssFiles.push(cssFileName);
146
149
  }
147
150
  }