UNPKG

ultimate-jekyll-manager

Version:
24 lines (18 loc) 879 B
// Libraries const Manager = new (require('../build.js')); const logger = Manager.logger('audit'); const { execute } = require('node-powertools'); // Load package const package = Manager.getPackage('main'); const project = Manager.getPackage('project'); module.exports = async function (options) { // Log logger.log(`Starting audit...`); // Get options with defaults const lighthouseUrl = options.lighthouseUrl || '/'; const autoExit = options.autoExit !== 'false'; // Default true unless explicitly 'false' // Build environment variables with all options const envVars = `UJ_AUDIT_FORCE=true UJ_MINIFY_HTML_FORCE=true UJ_PURGECSS=true UJ_AUDIT_LIGHTHOUSE_URL="${lighthouseUrl}" UJ_AUDIT_AUTOEXIT=${autoExit}`; // Run the full build process with audit force enabled await execute(`npx uj clean && ${envVars} bundle exec npm run gulp --`, { log: true }) };