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