Open liudonghua123 opened 5 months ago
1.1.2
Microsoft Windows [Version 10.0.22631.3374]
@marsaud/smb2
write index.js with the following contents.
// load the library import SMB2 from '@marsaud/smb2'; const { USERNAME: username, PASSWORD: password, DOMAIN: domain, share: share, FILEPATH } = process.env; // https://github.com/Node-SMB/marsaud-smb2 // create an SMB2 instance var smb2Client = new SMB2({ share: share ?? String.raw`\\113.55.127.140\hp`, domain: domain ?? 'DOMAIN', username, password, }); const filePath = FILEPATH ?? 'foo.txt' const content = await smb2Client.readFile(filePath); console.log(`Content of ${filePath}: ${content.toString('utf-8')}`); smb2Client.disconnect();
bun build index.js --compile --target=node --minify --outfile=out\index.exe
out\index.exe
The binary is executed normally.
I also tried --target=bun, it's the same problem.
--target=bun
If I use ncc to build single js and then use bun to compile, it works.
I found `module "../messages/negotiate" come from here which is dynamic loaded, maybe it's the root issue.
What version of Bun is running?
1.1.2
What platform is your computer?
Microsoft Windows [Version 10.0.22631.3374]
What steps can reproduce the bug?
@marsaud/smb2
dependences.write index.js with the following contents.
bun build index.js --compile --target=node --minify --outfile=out\index.exe
andout\index.exe
What is the expected behavior?
The binary is executed normally.
What do you see instead?
Additional information
I also tried
--target=bun
, it's the same problem.If I use ncc to build single js and then use bun to compile, it works.