hyperspan 1.0.8 → 1.0.10

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 +2 -2
  2. package/src/server.ts +7 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hyperspan",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "description": "Hyperspan CLI - for @hyperspan/framework",
5
5
  "type": "module",
6
6
  "public": true,
@@ -33,7 +33,7 @@
33
33
  "test": "bun test"
34
34
  },
35
35
  "dependencies": {
36
- "@hyperspan/framework": "^1.0.13",
36
+ "@hyperspan/framework": "^1.0.14",
37
37
  "bun-plugin-tailwind": "^0.1.2",
38
38
  "commander": "^14.0.3",
39
39
  "degit": "^2.8.4"
package/src/server.ts CHANGED
@@ -75,6 +75,10 @@ export async function addDirectoryAsRoutes(
75
75
  const buildDir = join(CWD, '.build');
76
76
  const cssPublicDir = join(CWD, server._config.publicDir, CSS_PUBLIC_PATH);
77
77
 
78
+ // Read local package.json to get the dependencies, so we can exclude them from the build for CSS below.
79
+ const packageJson = await Bun.file(join(CWD, 'package.json')).json();
80
+ const dependencies = packageJson.dependencies;
81
+
78
82
  log(`Scanning directory for routes: ${directoryPath}`);
79
83
 
80
84
  try {
@@ -135,11 +139,14 @@ export async function addDirectoryAsRoutes(
135
139
  minify: IS_PROD,
136
140
  format: 'esm',
137
141
  target: 'node',
142
+ // Only extract CSS — don't bundle framework packages, dependencies, or component files.
143
+ external: [...Object.keys(dependencies), '@hyperspan/*', '*.vue', '*.svelte', '*.tsx', '*.jsx', '*.ts', '*.js'],
138
144
  });
139
145
 
140
146
  // Move CSS files to the public directory
141
147
  for (const output of buildResult.outputs) {
142
148
  if (output.path.endsWith('.css')) {
149
+ // Use content hash for filename so that we don't duplicate CSS files with the same content (helps browser caching).
143
150
  const contentHash = output.hash;
144
151
  const cssFileName = `${contentHash}.css`;
145
152
  const cssOutputFile = Bun.file(output.path);