/
githubmirror
/
angular-cli
Обзор
Документация
Войти
/
githubmirror
/
angular-cli
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/angular_devkit/build_angular/src/utils/output-paths.ts
28 строк
853 B
Joey Perrott
refactor: move builtin module imports to use node: prefix imports
14 фев 2025, 22:09
14 фев 2025, 22:09
33ed6e8
Код
Авторство
О чём код?
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import { existsSync, mkdirSync } from 'node:fs'; import { join } from 'node:path'; import { I18nOptions } from './i18n-webpack'; export function ensureOutputPaths(baseOutputPath: string, i18n: I18nOptions): Map<string, string> { const outputPaths: [string, string][] = i18n.shouldInline ? [...i18n.inlineLocales].map((l) => [ l, i18n.flatOutput ? baseOutputPath : join(baseOutputPath, i18n.locales[l].subPath), ]) : [['', baseOutputPath]]; for (const [, outputPath] of outputPaths) { if (!existsSync(outputPath)) { mkdirSync(outputPath, { recursive: true }); } } return new Map(outputPaths); }