mirror of
https://github.com/nbd-wtf/nostr-tools.git
synced 2025-12-08 16:28:49 +00:00
26 lines
562 B
JavaScript
Executable File
26 lines
562 B
JavaScript
Executable File
#!/usr/bin/env node
|
|
|
|
const esbuild = require('esbuild')
|
|
const alias = require('esbuild-plugin-alias')
|
|
const nodeGlobals = require('@esbuild-plugins/node-globals-polyfill').default
|
|
|
|
const buildOptions = {
|
|
entryPoints: ['index.js'],
|
|
outfile: 'nostr.js',
|
|
bundle: true,
|
|
format: 'esm',
|
|
plugins: [
|
|
alias({
|
|
stream: require.resolve('readable-stream')
|
|
}),
|
|
nodeGlobals({buffer: true})
|
|
],
|
|
define: {
|
|
window: 'self',
|
|
global: 'self'
|
|
},
|
|
loader: {'.js': 'jsx'}
|
|
}
|
|
|
|
esbuild.build(buildOptions).then(() => console.log('build success.'))
|