forked from tornado-packages/noble-curves
Add build directory that allows to test tree-shaking
This commit is contained in:
parent
b281167e8d
commit
6f10632ac0
7
build/README.md
Normal file
7
build/README.md
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# build
|
||||||
|
|
||||||
|
The directory is used to build a single file `noble-curves.js` which contains everything.
|
||||||
|
|
||||||
|
The output file uses iife wrapper and can be used in browsers as-is.
|
||||||
|
|
||||||
|
Don't use it unless you can't use NPM/ESM, which support tree shaking.
|
11
build/input.js
Normal file
11
build/input.js
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
import { bytesToHex, concatBytes, hexToBytes } from '@noble/curves/abstract/utils';
|
||||||
|
|
||||||
|
export { secp256k1 } from '@noble/curves/secp256k1';
|
||||||
|
export { ed25519, x25519 } from '@noble/curves/ed25519';
|
||||||
|
export { ed448, x448 } from '@noble/curves/ed448';
|
||||||
|
export { p256 } from '@noble/curves/p256';
|
||||||
|
export { p384 } from '@noble/curves/p384';
|
||||||
|
export { p521 } from '@noble/curves/p521';
|
||||||
|
export { bls12_381 } from '@noble/curves/bls12-381';
|
||||||
|
|
||||||
|
export const utils = { bytesToHex, concatBytes, hexToBytes };
|
18
build/package.json
Normal file
18
build/package.json
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"name": "build",
|
||||||
|
"private": true,
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "Used to build a single file",
|
||||||
|
"main": "input.js",
|
||||||
|
"keywords": [],
|
||||||
|
"type": "module",
|
||||||
|
"author": "",
|
||||||
|
"license": "MIT",
|
||||||
|
"devDependencies": {
|
||||||
|
"@noble/curves": "..",
|
||||||
|
"esbuild": "0.17.19"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"build": "npx esbuild --bundle input.js --outfile=noble-curves.js --global-name=nobleCurves"
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user