Skip to content

Commit 9849841

Browse files
committed
fix: potential fix for packaged executable
1 parent 11ce719 commit 9849841

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
postBuild = ''
6161
npm run pkg -- \
6262
--output=out \
63-
--bin=dist/polykey.js \
63+
--bin=dist/polykey.mjs \
6464
--node-version=${utils.nodeVersion} \
6565
--platform=${platform} \
6666
--arch=${arch}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
"node_modules/sodium-native/prebuilds/win32-x64/node.napi.node"
106106
],
107107
"scripts": [
108-
"dist/polykeyWorkerManifest.mjs"
108+
"dist/polykeyWorkerManifest.js"
109109
]
110110
},
111111
"scripts": {

scripts/build.mjs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,28 @@ async function main(argv = process.argv) {
9292
console.error('Running esbuild:');
9393
console.error(esbuildOptions);
9494
await esbuild.build(esbuildOptions);
95+
// Rename worker script
96+
console.error('Renaming worker script');
97+
childProcess.execFileSync(
98+
'mv',
99+
['dist/polykeyWorkerManifest.mjs', 'dist/polykeyWorkerManifest.js'],
100+
{
101+
stdio: ['inherit', 'inherit', 'inherit'],
102+
windowsHide: true,
103+
encoding: 'utf-8',
104+
shell: platform === 'win32' ? true : false,
105+
},
106+
);
107+
childProcess.execFileSync(
108+
'mv',
109+
['dist/polykeyWorkerManifest.mjs.map', 'dist/polykeyWorkerManifest.js.map'],
110+
{
111+
stdio: ['inherit', 'inherit', 'inherit'],
112+
windowsHide: true,
113+
encoding: 'utf-8',
114+
shell: platform === 'win32' ? true : false,
115+
},
116+
);
95117
}
96118
/* eslint-enable no-console */
97119

0 commit comments

Comments
 (0)