ngx-agora
Version:
Angular wrapper for Agora RTC client (https://www.agora.io/en/)
20 lines • 1.21 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const schematics_1 = require("@angular-devkit/schematics");
const project_configurations_1 = require("./project-configurations");
function getProjectEnvironmentFile(project) {
const configurations = project_configurations_1.getProjectTargetConfigurations(project, 'build');
if (!configurations.production ||
!configurations.production.fileReplacements ||
configurations.production.fileReplacements.length === 0) {
throw new schematics_1.SchematicsException(`Could not find the configuration of the workspace config (${project.sourceRoot})`);
}
const fileReplacements = configurations.production.fileReplacements;
const fileReplacement = fileReplacements.find((replacement) => /environment\.ts$/.test(replacement.replace));
if (fileReplacement === undefined) {
throw new schematics_1.SchematicsException(`Could not find the environment file replacement configuration of the workspace config (${project.sourceRoot})`);
}
return fileReplacement.replace;
}
exports.getProjectEnvironmentFile = getProjectEnvironmentFile;
//# sourceMappingURL=project-environment-file.js.map