2024-04-25 13:51:42 +03:00
|
|
|
const path = require('path');
|
2024-05-06 05:14:08 +03:00
|
|
|
const { BannerPlugin } = require('webpack');
|
2024-04-25 13:51:42 +03:00
|
|
|
|
|
|
|
const esbuildLoader = {
|
|
|
|
test: /\.ts?$/,
|
|
|
|
loader: 'esbuild-loader',
|
|
|
|
options: {
|
|
|
|
loader: 'ts',
|
|
|
|
target: 'es2016',
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = [
|
2024-04-29 08:04:44 +03:00
|
|
|
{
|
|
|
|
mode: 'production',
|
|
|
|
module: {
|
|
|
|
rules: [esbuildLoader]
|
|
|
|
},
|
|
|
|
entry: './src/cli.ts',
|
|
|
|
output: {
|
|
|
|
filename: 'cli.js',
|
|
|
|
path: path.resolve(__dirname, './dist'),
|
|
|
|
},
|
|
|
|
target: 'node',
|
2024-05-06 05:14:08 +03:00
|
|
|
plugins: [
|
|
|
|
new BannerPlugin({
|
|
|
|
banner: '#!/usr/bin/env node\n',
|
|
|
|
raw: true
|
|
|
|
})
|
|
|
|
],
|
2024-04-29 08:04:44 +03:00
|
|
|
resolve: {
|
|
|
|
extensions: ['.tsx', '.ts', '.js'],
|
2024-05-08 17:28:08 +03:00
|
|
|
alias: {
|
|
|
|
'fflate': 'fflate/node'
|
|
|
|
},
|
2024-04-29 20:01:09 +03:00
|
|
|
fallback: {
|
|
|
|
'@tornado/websnark/src/utils': '@tornado/websnark/src/utils.js',
|
|
|
|
'@tornado/websnark/src/groth16': '@tornado/websnark/src/groth16.js',
|
2024-04-25 13:51:42 +03:00
|
|
|
}
|
|
|
|
},
|
|
|
|
optimization: {
|
|
|
|
minimize: false,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
];
|