UNPKG

@angular-buildx/esbuild

Version:

A custom Angular CLI builder for extending Esbuild configuration in Angular projects.

22 lines (21 loc) 844 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.extractExtentions = void 0; const path_1 = __importDefault(require("path")); const fs_1 = require("fs"); const extractExtentions = (options, context) => { if (!options.extentions) { return {}; } const extentionsPath = path_1.default.resolve(context.workspaceRoot, options.extentions); if (!(0, fs_1.existsSync)(extentionsPath)) { context.logger.error(`The extentions file ${extentionsPath} does not exist.`); return {}; } context.logger.warn(`Using extentions file ${extentionsPath}`); return require(extentionsPath); }; exports.extractExtentions = extractExtentions;