first commit
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env node
|
||||
/**
|
||||
* Bundle Protomux + compact-encoding + b4a for the browser extension.
|
||||
* Output: extension/protomux-bundle.js (IIFE, assigned to window.BridgeSwarmProtomux)
|
||||
*/
|
||||
const esbuild = require('esbuild');
|
||||
const path = require('path');
|
||||
|
||||
const root = path.resolve(__dirname, '..');
|
||||
const entry = path.join(root, 'extension', 'protomux-entry.cjs');
|
||||
const outfile = path.join(root, 'extension', 'protomux-bundle.js');
|
||||
|
||||
esbuild
|
||||
.build({
|
||||
entryPoints: [entry],
|
||||
bundle: true,
|
||||
format: 'iife',
|
||||
globalName: 'BridgeSwarmProtomux',
|
||||
outfile,
|
||||
platform: 'browser',
|
||||
mainFields: ['browser', 'module', 'main'],
|
||||
minify: false,
|
||||
})
|
||||
.then(() => console.log('Built', outfile))
|
||||
.catch((err) => {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
Reference in New Issue
Block a user