next-bun-compile 0.6.6 → 0.6.7

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/dist/cli.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  compile,
4
4
  generateEntryPoint
5
- } from "./index-c4yr0spy.js";
5
+ } from "./index-qhwqnqff.js";
6
6
 
7
7
  // src/cli.ts
8
8
  import { existsSync } from "node:fs";
@@ -431,11 +431,13 @@ async function extractAssets() {
431
431
  path.join(aliasPath, "package.json"),
432
432
  JSON.stringify({ name: alias, main: "index.js" })
433
433
  );
434
- // Relative path bypasses bun's package-name resolver, which doesn't
435
- // walk up to the parent node_modules from inside an alias directory.
434
+ // Absolute path. bun's compiled-binary resolver won't traverse "."/".."
435
+ // segments out of a dynamically-written shim (presumably tied to the
436
+ // module's original compile-time location, not its on-disk path), so
437
+ // a literal absolute target is the only thing that resolves reliably.
436
438
  fs.writeFileSync(
437
439
  path.join(aliasPath, "index.js"),
438
- "module.exports = require(" + JSON.stringify("../" + target) + ");"
440
+ "module.exports = require(" + JSON.stringify(path.join(baseDir, ".next/node_modules", target)) + ");"
439
441
  );
440
442
  }
441
443
  for (const sub of subpaths) {
@@ -443,12 +445,9 @@ async function extractAssets() {
443
445
  const shimFile = path.join(aliasPath, subKey + ".js");
444
446
  if (fs.existsSync(shimFile)) continue;
445
447
  fs.mkdirSync(path.dirname(shimFile), { recursive: true });
446
- const canonicalFile = path.join(baseDir, ".next/node_modules", target, subKey);
447
- const rel = path.relative(path.dirname(shimFile), canonicalFile);
448
- const spec = rel.startsWith(".") ? rel : "./" + rel;
449
448
  fs.writeFileSync(
450
449
  shimFile,
451
- "module.exports = require(" + JSON.stringify(spec) + ");"
450
+ "module.exports = require(" + JSON.stringify(path.join(baseDir, ".next/node_modules", target, subKey)) + ");"
452
451
  );
453
452
  }
454
453
  }
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  __require,
3
3
  compile,
4
4
  generateEntryPoint
5
- } from "./index-c4yr0spy.js";
5
+ } from "./index-qhwqnqff.js";
6
6
 
7
7
  // src/index.ts
8
8
  import { join } from "node:path";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-bun-compile",
3
- "version": "0.6.6",
3
+ "version": "0.6.7",
4
4
  "description": "Next.js Build Adapter that compiles your app into a Bun single-file executable",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",