diff --git a/lib/runner.js b/lib/runner.js index 388fceb..5a39fd7 100644 --- a/lib/runner.js +++ b/lib/runner.js @@ -1,7 +1,6 @@ -// lighthouse & chrome-launcher are ESM only/compatible, imported dynamically +// lighthouse, chrome-launcher, uuid are ESM only/compatible, imported dynamically const fs = require('fs'); const path = require('path'); -const { v4: uuidv4 } = require('uuid'); /** * Run a performance test using Lighthouse @@ -10,9 +9,10 @@ const { v4: uuidv4 } = require('uuid'); * @returns {Promise} - Test results */ async function runTest(url, options = {}) { - // Dynamically import Lighthouse & Chrome Launcher (ESM) + // Dynamically import dependencies (ESM) const { default: lighthouse } = await import('lighthouse'); const { default: chromeLauncher } = await import('chrome-launcher'); + const { v4: uuidv4 } = await import('uuid'); const isMobile = options.isMobile ?? true; // Default to mobile const reportDir = path.join(__dirname, '..', 'reports');