next-bun-compile 0.10.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/dist/cli.js
CHANGED
|
@@ -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_${
|
|
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}],`);
|
package/dist/index.js
CHANGED