UNPKG

@ng-doc/builder

Version:

<!-- PROJECT LOGO --> <br /> <div align="center"> <a href="https://github.com/ng-doc/ng-doc"> <img src="https://ng-doc.com/assets/images/ng-doc.svg?raw=true" alt="Logo" height="150px"> </a>

31 lines 1.26 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.patchBuilderContext = patchBuilderContext; // The DevServer uses EsBuild only for specific builder names. // https://github.com/just-jeb/angular-builders/blob/dbf4d281a29c2f93d309bba0e155c3a22965130c/packages/custom-esbuild/src/dev-server/patch-builder-context.ts#L14-L47 /** * * @param context * @param config * @param config.mock * @param config.with * @param config.optionsTransform */ function patchBuilderContext(context, config) { const getBuilderNameForTarget = async (target) => { const builderName = await context.getBuilderNameForTarget(target); if (!config.mock.includes(builderName)) return builderName; return config.with; }; const getTargetOptions = async (target) => { const builderName = await context.getBuilderNameForTarget(target); if (!config.mock.includes(builderName)) return context.getTargetOptions(target); const options = await context.getTargetOptions(target); config.optionsTransform(options); return options; }; return { ...context, getBuilderNameForTarget, getTargetOptions }; } //# sourceMappingURL=patch-builder-context.js.map