Skip to content

Commit

Permalink
fix(lambda): require esbuild-wasm conditionally to fix lambda failure (
Browse files Browse the repository at this point in the history
  • Loading branch information
bernardobridge authored Jan 9, 2024
1 parent 0d6a000 commit 213bcb5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/artillery/lib/cmds/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ const fs = require('fs');
const path = require('path');
const crypto = require('crypto');
const os = require('os');
const esbuild = require('esbuild-wasm');
const createLauncher = require('../launch-platform');
const createConsoleReporter = require('../../console-reporter');

Expand Down Expand Up @@ -406,6 +405,10 @@ function replaceProcessorIfTypescript(script, scriptPath, platform) {
`${processorFileName}-${Date.now()}.js`
);

//TODO: move require to top of file when Lambda bundle size issue is solved
//must be conditionally required for now as this package is removed in Lambda for now to avoid bigger package sizes
const esbuild = require('esbuild-wasm');

try {
esbuild.buildSync({
entryPoints: [actualProcessorPath],
Expand Down

0 comments on commit 213bcb5

Please sign in to comment.