Build cli.js from webpack instead of rollup.js

This commit is contained in:
Tornado Contrib 2024-04-29 05:04:44 +00:00
parent a5b87ccf74
commit 8a0bd4a0d6
Signed by: tornadocontrib
GPG Key ID: 60B4DF1A076C64B1
2 changed files with 20 additions and 22 deletions

@ -55,28 +55,6 @@ const config = [
json() json()
], ],
}, },
{
input: 'src/cli.ts',
output: [
{
file: pkgJson.bin[pkgJson.name],
format: "cjs",
esModule: false,
banner: '#!/usr/bin/env node\n'
},
],
plugins: [
esbuild({
include: /\.[jt]sx?$/,
minify: false,
sourceMap: true,
target: 'es2016',
}),
commonjs(),
nodeResolve(),
json()
],
},
{ {
input: 'src/merkleTreeWorker.ts', input: 'src/merkleTreeWorker.ts',
output: [ output: [

@ -53,6 +53,26 @@ module.exports = [
minimize: false, minimize: false,
} }
}, },
{
mode: 'production',
module: {
rules: [esbuildLoader]
},
entry: './src/cli.ts',
output: {
filename: 'cli.js',
path: path.resolve(__dirname, './dist'),
},
target: 'node',
plugins: [],
resolve: {
extensions: ['.tsx', '.ts', '.js'],
alias: {}
},
optimization: {
minimize: false,
}
},
{ {
mode: 'production', mode: 'production',
module: { module: {