Skip to content

Commit

Permalink
added browser bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
Egge21M committed Aug 22, 2024
1 parent 9bc65d0 commit d0f9383
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,19 @@ esbuild
format: 'cjs'
})
.catch(() => process.exit(1));

esbuild
.build({
bundle: true,
sourcemap: 'external',
entryPoints: ['src/index.ts'],
outfile: 'lib/cashu.bundle.js',
format: 'iife',
globalName: 'CashuTs',
define: {
window: 'self',
global: 'self',
process: '{"env": {}}'
}
})
.then(() => console.log('standalone build success.'));
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { CashuMint } from './CashuMint';
import { CashuWallet } from './CashuWallet';
import { setGlobalRequestOptions } from './request';
import { generateNewMnemonic, deriveSeedFromMnemonic } from '@cashu/crypto/modules/client/NUT09';
import { getEncodedToken, getDecodedToken, deriveKeysetId } from './utils';
import { getEncodedToken, getDecodedToken, getEncodedTokenV4, deriveKeysetId } from './utils';

export * from './model/types/index.js';

Expand Down

0 comments on commit d0f9383

Please sign in to comment.