tornado-cli/webpack.config.js

46 lines
1.1 KiB
JavaScript
Raw Normal View History

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