UNPKG

nostr-web-components

Version:

collection of web components that provide quick access to basic nostr things

40 lines (34 loc) 887 B
const fs = require('node:fs') const esbuild = require('esbuild') const { join } = require('path') const all = fs .readdirSync(process.cwd()) .filter(file => file.endsWith('.ts') && fs.statSync(join(process.cwd(), file)).isFile()) const components = all.filter(file => file.startsWith('nostr-')) esbuild .build({ entryPoints: components, bundle: true, sourcemap: 'external', outdir: 'dist/', format: 'iife', }) .then(() => console.log('standalone components build success.')) esbuild .build({ entryPoints: ['index.ts'], bundle: true, sourcemap: 'external', outdir: 'dist/', format: 'iife', }) .then(() => console.log('big bundle build success.')) esbuild .build({ entryPoints: all, bundle: false, sourcemap: 'external', outdir: 'lib/', format: 'esm', }) .then(() => console.log('lib build success.'))