Skip to content

Commit

Permalink
Add some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dayongkr committed Oct 14, 2024
1 parent 2798387 commit 6637a01
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions .scripts/bench-runner.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ import commonjsPlugin from '@rollup/plugin-commonjs';
import resolvePlugin from '@rollup/plugin-node-resolve';
import tsPlugin from '@rollup/plugin-typescript';

const includeStrings = process.argv.slice(2);

if (includeStrings.length === 0) {
includeStrings.push('.');
}

const OUTPUT_DIR = '.bench-bundle';
const dirPath = resolve(process.cwd(), OUTPUT_DIR);

Expand All @@ -22,6 +16,8 @@ if (existsSync(dirPath)) {
const benchmarkDir = resolve(process.cwd(), 'benchmarks/performance');
const allBenchmarkFiles = readdirSync(benchmarkDir);

const includeStrings = process.argv[2] ? process.argv.slice(2) : ['.']; // default to all benchmarks

for (const includeString of includeStrings) {
const targetBenchFiles = allBenchmarkFiles.filter(f => f.includes(includeString));

Expand All @@ -37,17 +33,17 @@ for (const includeString of includeStrings) {
input: resolve(benchmarkDir, file),
plugins: [
tsPlugin({
tsconfig: resolve(process.cwd(), 'tsconfig.build.json'),
tsconfig: resolve(process.cwd(), 'tsconfig.build.json'), // for transforming `benchmarks/**/*.ts`
compilerOptions: {
sourceMap: false,
inlineSources: false,
removeComments: true,
declaration: false,
},
}),
commonjsPlugin(),
commonjsPlugin(), // for importing `lodash`
resolvePlugin({
extensions: ['.mjs', '.js', '.json', '.node', '.ts'],
extensions: ['.mjs', '.js', '.json', '.node', '.ts'], // for running on Node.js
}),
],
logLevel: 'silent',
Expand Down

0 comments on commit 6637a01

Please sign in to comment.