UNPKG

just-scripts

Version:
20 lines 788 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.esbuildTask = void 0; const just_task_1 = require("just-task"); /** * creates a esbuild task function, checking for esbuild's presence; can be used for bundling or building */ function esbuildTask(options = {}) { // Resolve first from cwd, then through resolution paths const esbuildModuleResolution = just_task_1.resolve('esbuild'); if (!esbuildModuleResolution) { throw new Error('cannot find esbuild, please add it to your devDependencies'); } return async function esbuild() { const esbuildModule = require(esbuildModuleResolution); return esbuildModule.build(options); }; } exports.esbuildTask = esbuildTask; //# sourceMappingURL=esbuildTask.js.map