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
|
@@ -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
|
-
//
|
|
435
|
-
//
|
|
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("
|
|
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(
|
|
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