This repository was archived by the owner on Jan 29, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 71
Expand file tree
/
Copy pathrollup.benchmarks.config.js
More file actions
83 lines (81 loc) · 2.61 KB
/
rollup.benchmarks.config.js
File metadata and controls
83 lines (81 loc) · 2.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import typescript from '@rollup/plugin-typescript';
import json from '@rollup/plugin-json';
import terser from '@rollup/plugin-terser';
import { visualizer } from 'rollup-plugin-visualizer';
const isProduction = process.env.NODE_ENV === 'production';
export default {
input: {
'benchmark-runner': 'src/benchmarks/benchmark-runner.js',
'google-services-performance': 'src/benchmarks/google-services-performance-framework.js',
'load-testing-coordinator': 'src/benchmarks/load-testing-coordinator.js',
'performance-optimization-strategies': 'src/benchmarks/performance-optimization-strategies.js'
},
output: [
{
dir: 'dist/benchmarks',
format: 'es',
sourcemap: !isProduction,
entryFileNames: '[name].js',
chunkFileNames: 'shared/[name]-[hash].js'
},
{
dir: 'dist/benchmarks/cjs',
format: 'cjs',
sourcemap: !isProduction,
entryFileNames: '[name].cjs',
chunkFileNames: 'shared/[name]-[hash].cjs'
}
],
external: [
// Node.js built-ins
'crypto', 'events', 'fs', 'http', 'https', 'net', 'os', 'path', 'stream', 'url', 'util',
'perf_hooks', 'worker_threads', 'cluster', 'child_process',
// External dependencies
'express', 'ws', 'redis', 'mongodb', 'kafka-node', 'prometheus-client',
'pino', 'joi', 'lodash', 'moment', 'uuid', 'crypto-js', 'jsonwebtoken',
'bcryptjs', 'helmet', 'cors', 'compression', 'rate-limiter-flexible',
'bull', 'ioredis', 'pg', 'sequelize', 'mongoose', 'axios', 'node-fetch',
'puppeteer', 'sharp', 'canvas', 'ffmpeg-static', 'jimp', 'multer',
'socket.io', 'socket.io-client', 'eventemitter3', 'p-queue', 'p-retry',
'p-timeout', 'async', 'rxjs', 'zod', 'dotenv', 'config'
],
plugins: [
resolve({
preferBuiltins: true,
browser: false
}),
commonjs(),
typescript({
tsconfig: './tsconfig.json',
sourceMap: !isProduction,
inlineSources: !isProduction
}),
json(),
...(isProduction ? [
terser({
compress: {
drop_console: false, // Keep console for benchmarking output
drop_debugger: true
},
mangle: {
keep_classnames: true,
keep_fnames: true
}
})
] : []),
visualizer({
filename: 'dist/benchmarks/bundle-analysis.html',
open: false,
gzipSize: true
})
],
onwarn: (warning, warn) => {
// Suppress circular dependency warnings for known safe cases
if (warning.code === 'CIRCULAR_DEPENDENCY') {
return;
}
warn(warning);
}
};