We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.1.26
5.15.0-43-generic x86_64 x86_64 x86_64 GNU/Linux
$ bun install esvu $ bun build ./node_modules/esvu/src/bin.js --compile --packages=bundle --root=./node_modules/esvu/src/ --outfile=esvu $ esvu --help
The compiled esvu executable to print the help entries.
esvu
$ ./esvu --help error: Cannot find module "./engines/boa.js" from "/$bunfs/root/esvu" Bun v1.1.26 (Linux x64 baseline)
Deno's compile just works.
compile
$ deno compile -A npm:esvu $ ./esvu --help esvu [command] Commands: esvu install <engine> Install <engine> esvu uninstall <engine> Uninstall <engine> esvu update <engine> Update <engine> Options: --help Show help [boolean] --version Show version number [boolean] --engines --fast
The text was updated successfully, but these errors were encountered:
The issue is /node_modules/esvu/dist/src/index.js
/node_modules/esvu/dist/src/index.js
'use strict'; const fs = require('fs'); const path = require('path'); const engines = {}; const enginesByName = {}; fs.readdirSync(path.join(__dirname, 'engines')) .forEach((f) => { if (!f.endsWith('.js')) { return; } const e = require(`./engines/${f}`); engines[e.config.id] = e; enginesByName[e.config.name.toLowerCase()] = e; });
becomes
// node_modules/esvu/src/index.js var require_src2 = __commonJS((exports, module) => { function getInstaller(name) { name = name.toLowerCase(); if (engines[name]) { return engines[name]; } if (enginesByName[name]) { return enginesByName[name]; } return; } var __dirname = "/home/user/node_modules/esvu/src"; var fs = import.meta.require("fs"); var path = import.meta.require("path"); var engines = {}; var enginesByName = {}; fs.readdirSync(path.join(__dirname, "engines")).forEach((f) => { if (!f.endsWith(".js")) { return; } const e = import.meta.require(`./engines/${f}`); engines[e.config.id] = e; enginesByName[e.config.name.toLowerCase()] = e; }); exports.getInstaller = getInstaller; exports.engines = engines; });
The bundle is looking for ./engines/${f} in the current directory. The path should be ${__dirname}/engines/${f}.
./engines/${f}
${__dirname}/engines/${f}
Adding the __dirname manually to the bundle works.
__dirname
Sorry, something went wrong.
Looks like the larger issue is the result of bun build --compile still depends on the source files after executable compilation #14676.
bun build --compile
No branches or pull requests
What version of Bun is running?
1.1.26
What platform is your computer?
5.15.0-43-generic x86_64 x86_64 x86_64 GNU/Linux
What steps can reproduce the bug?
What is the expected behavior?
The compiled
esvu
executable to print the help entries.What do you see instead?
Additional information
Deno's
compile
just works.The text was updated successfully, but these errors were encountered: