Files
client/build-pq-bundle.js
2026-07-12 10:11:00 -04:00

37 lines
958 B
JavaScript

/**
* Build script for the post-quantum crypto bundle.
* Bundles pq-crypto.mjs and all its dependencies into a single
* ESM file that can be loaded directly in the browser.
*
* Usage: node build-pq-bundle.js
*/
const esbuild = require('esbuild');
const path = require('path');
async function build() {
console.log('🔧 Building PQ crypto bundle...');
await esbuild.build({
entryPoints: ['www/js/pq-crypto.mjs'],
bundle: true,
format: 'esm',
target: ['es2020'],
outfile: 'www/pq-crypto.bundle.js',
sourcemap: true,
minify: false, // keep readable for demo
logLevel: 'info',
// Pure JS — no WASM files to handle
define: {
'process.env.NODE_ENV': '"production"'
}
});
console.log('✅ PQ crypto bundle built: www/pq-crypto.bundle.js');
}
build().catch(err => {
console.error('❌ Build failed:', err);
process.exit(1);
});