UNPKG

@jsverse/transloco

Version:

The internationalization (i18n) library for Angular

31 lines 1.19 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createTranslocoModule = void 0; const path = require("node:path"); const schematics_1 = require("@angular-devkit/schematics"); const array_1 = require("../../utils/array"); function createTranslocoModule({ isLib, ssr, langs, modulePath, sourceRoot, host, }) { const envPath = path .relative(modulePath, `${sourceRoot}/environments/environment`) .split(path.sep) .join('/'); const envFileExists = host.exists(`${sourceRoot}/environments/environment.ts`); let prodMode = envFileExists ? 'environment.production' : '!isDevMode()'; if (isLib) { prodMode = 'false'; } return (0, schematics_1.apply)((0, schematics_1.url)(`./files/transloco-module`), [ (0, schematics_1.template)({ ts: 'ts', stringifyList: array_1.stringifyList, isLib, langs, importEnv: ssr || envFileExists, envPath, prodMode, }), (0, schematics_1.move)('/', modulePath), ]); } exports.createTranslocoModule = createTranslocoModule; //# sourceMappingURL=root-module.gen.js.map