-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathbuild_shamir.js
More file actions
25 lines (24 loc) · 770 Bytes
/
Copy pathbuild_shamir.js
File metadata and controls
25 lines (24 loc) · 770 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Bundle the combined SLIP-39 + SSKR entry via esbuild + Node polyfills.
const esbuild = require('esbuild');
const { polyfillNode } = require('esbuild-plugin-polyfill-node');
esbuild.build({
entryPoints: ['src/www/js/lib/_shamir_entry.js'],
bundle: true,
format: 'iife',
globalName: '__shamirBundle',
minify: true,
target: 'es2020',
outfile: 'src/www/js/lib/shamir.js',
plugins: [
polyfillNode({
globals: { buffer: true, process: true },
polyfills: { crypto: true, stream: true, buffer: true, process: true, util: true, events: true, string_decoder: true, assert: true },
}),
],
define: { 'global': 'globalThis' },
}).then(() => {
console.log('shamir.js bundled');
}).catch((e) => {
console.error(e);
process.exit(1);
});