mirror of
https://github.com/di-sukharev/opencommit.git
synced 2026-01-12 23:28:16 -05:00
feat(package.json): add @dqbd/tiktoken dependency fix(tokenCount.ts): uncomment Tiktoken import and encoding, and return token length instead of an approximation
15 lines
342 B
JavaScript
15 lines
342 B
JavaScript
import { build } from 'esbuild'
|
|
import fs from 'fs'
|
|
|
|
await build({
|
|
entryPoints: ['./src/cli.ts'],
|
|
bundle: true,
|
|
platform: 'node',
|
|
format: 'cjs',
|
|
outfile: './out/cli.cjs',
|
|
});
|
|
|
|
const wasmFile = fs.readFileSync('./node_modules/@dqbd/tiktoken/lite/tiktoken_bg.wasm')
|
|
|
|
fs.writeFileSync('./out/tiktoken_bg.wasm', wasmFile)
|