next-bun-compile 0.9.0 → 0.10.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.
package/README.md CHANGED
@@ -89,7 +89,7 @@ You'll need to upload `.next/static/` to your CDN separately.
89
89
 
90
90
  ## Performance
91
91
 
92
- The compiled binary uses Bun's `--bytecode` flag to pre-compile JavaScript to bytecode at build time, skipping the parsing step at startup. Code is also minified and dead code paths (dev-only modules, non-turbo runtimes) are eliminated via `--define` flags.
92
+ The compiled binary is minified, and dead code paths (dev-only modules, non-turbo runtimes) are eliminated via `--define` flags. Startup skips module resolution for the bundled server core entirely — the code is already in the binary.
93
93
 
94
94
  Benchmarks on a real Next.js app (both running on Bun's runtime):
95
95
 
package/dist/cli.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  compile,
4
4
  generateEntryPoint
5
- } from "./index-45tzedws.js";
5
+ } from "./index-hb6dh1nm.js";
6
6
 
7
7
  // src/cli.ts
8
8
  import { existsSync } from "node:fs";
@@ -46,10 +46,9 @@ function walkDir(dir, base = dir) {
46
46
  }
47
47
  return results;
48
48
  }
49
- function toVarName(filePath) {
50
- const hash = createHash("sha256").update(filePath).digest("hex").slice(0, 6);
49
+ function toVarName(filePath, index) {
51
50
  const safe = filePath.replace(/[^a-zA-Z0-9]/g, "_").slice(0, 40);
52
- return `asset_${safe}_${hash}`;
51
+ return `asset_${index}_${safe}`;
53
52
  }
54
53
  function findPackageDirs(standaloneDir, pkg) {
55
54
  const dirs = [];
@@ -560,8 +559,8 @@ function generateEntryPoint(options) {
560
559
  const buildHash = hasher.digest("hex");
561
560
  const imports = [];
562
561
  const mapEntries = [];
563
- for (const asset of assetsToEmbed) {
564
- const varName = toVarName(asset.urlPath);
562
+ for (const [i, asset] of assetsToEmbed.entries()) {
563
+ const varName = toVarName(asset.urlPath, i);
565
564
  const importPath = relative(serverDir, asset.absolutePath).replace(/\\/g, "/");
566
565
  imports.push(`import ${varName} from "./${importPath}" with { type: "file" };`);
567
566
  mapEntries.push(` ["${asset.urlPath}", ${varName}],`);
@@ -844,7 +843,6 @@ function compile(options) {
844
843
  "--production",
845
844
  "--compile",
846
845
  "--minify",
847
- "--bytecode",
848
846
  "--sourcemap",
849
847
  "--define",
850
848
  "process.env.TURBOPACK=1",
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  compile,
3
3
  generateEntryPoint
4
- } from "./index-45tzedws.js";
4
+ } from "./index-hb6dh1nm.js";
5
5
  export {
6
6
  generateEntryPoint,
7
7
  compile
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-bun-compile",
3
- "version": "0.9.0",
3
+ "version": "0.10.1",
4
4
  "description": "Compile your Next.js app into a Bun single-file executable",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",