-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathbuild_miniscript.js
More file actions
23 lines (22 loc) · 933 Bytes
/
Copy pathbuild_miniscript.js
File metadata and controls
23 lines (22 loc) · 933 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Bundle miniscript policy + analyser into js/lib/miniscript.js
const esbuild = require('esbuild');
const { polyfillNode } = require('esbuild-plugin-polyfill-node');
esbuild.build({
entryPoints: ['src/www/js/lib/_miniscript_entry.js'],
bundle: true,
format: 'iife',
globalName: '__miniscriptBundle',
minify: true,
target: 'es2020',
outfile: 'src/www/js/lib/miniscript.js',
plugins: [
polyfillNode({
globals: { buffer: true, process: true },
polyfills: { crypto: true, buffer: true, process: true, util: true, stream: true, events: true, string_decoder: true, assert: true, path: true, fs: false },
}),
],
define: { 'global': 'globalThis' },
// Stub out the optional Ledger client - we never use it in the browser.
alias: { '@ledgerhq/ledger-bitcoin': './build_stub_empty.js' },
}).then(() => console.log('miniscript.js bundled'))
.catch((e) => { console.error(e); process.exit(1); });