Files
js-crypto/scripts/node.js
Dimasik Kolezhniuk 116bdb3a57 ESM module migration (#21)
* ESM module migration

* Update typescript

* Add to bigInt function for PK

* 1.2.0

* Format

* Renaming. Fix lint

* Update package version

* Update package lock

* Update package lock

* Update package lock

* add audited blake hash. Fix esm for node

* Fixes
2025-02-18 14:31:36 +01:00

33 lines
606 B
JavaScript

import { build } from 'esbuild';
import { exit } from 'process';
import pkg from '../package.json' with { type: 'json' };
const external = [
...Object.keys(pkg.dependencies || {}),
...Object.keys(pkg.peerDependencies || {}),
];
const baseConfig = {
entryPoints: ['src/index.ts'],
bundle: true,
minify: false,
sourcemap: true,
platform: 'node',
target: 'es2022',
outfile: 'dist/node/esm/index.js',
format: 'esm',
external
};
build({
...baseConfig
}).catch(() => exit(1));
build({
...baseConfig,
format: 'cjs',
outfile: 'dist/node/cjs/index.cjs',
}).catch(() => exit(1));