@angular/compiler-cli
Advanced tools
Comparing version
{ | ||
"name": "@angular/compiler-cli", | ||
"version": "4.1.1", | ||
"version": "4.2.0-beta.0", | ||
"description": "Angular - the compiler CLI for Node.js", | ||
@@ -12,3 +12,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"@angular/tsc-wrapped": "4.1.1", | ||
"@angular/tsc-wrapped": "4.2.0-beta.0", | ||
"reflect-metadata": "^0.1.2", | ||
@@ -19,4 +19,4 @@ "minimist": "^1.2.0" | ||
"typescript": "^2.0.2", | ||
"@angular/compiler": "4.1.1", | ||
"@angular/core": "4.1.1" | ||
"@angular/compiler": "4.2.0-beta.0", | ||
"@angular/core": "4.2.0-beta.0" | ||
}, | ||
@@ -23,0 +23,0 @@ "repository": { |
@@ -14,2 +14,3 @@ /** | ||
var compiler = require("@angular/compiler"); | ||
var core_1 = require("@angular/core"); | ||
var fs_1 = require("fs"); | ||
@@ -49,15 +50,29 @@ var compiler_host_1 = require("./compiler_host"); | ||
} | ||
var transFile = cliOptions.i18nFile; | ||
var locale = cliOptions.locale; | ||
var transContent = ''; | ||
if (transFile) { | ||
if (!locale) { | ||
throw new Error("The translation file (" + transFile + ") locale must be provided. Use the --locale option."); | ||
if (cliOptions.i18nFile) { | ||
if (!cliOptions.locale) { | ||
throw new Error("The translation file (" + cliOptions.i18nFile + ") locale must be provided. Use the --locale option."); | ||
} | ||
transContent = fs_1.readFileSync(transFile, 'utf8'); | ||
transContent = fs_1.readFileSync(cliOptions.i18nFile, 'utf8'); | ||
} | ||
var missingTranslation = core_1.MissingTranslationStrategy.Warning; | ||
if (cliOptions.missingTranslation) { | ||
switch (cliOptions.missingTranslation) { | ||
case 'error': | ||
missingTranslation = core_1.MissingTranslationStrategy.Error; | ||
break; | ||
case 'warning': | ||
missingTranslation = core_1.MissingTranslationStrategy.Warning; | ||
break; | ||
case 'ignore': | ||
missingTranslation = core_1.MissingTranslationStrategy.Ignore; | ||
break; | ||
default: | ||
throw new Error("Unknown option for missingTranslation (" + cliOptions.missingTranslation + "). Use either error, warning or ignore."); | ||
} | ||
} | ||
var aotCompiler = compiler.createAotCompiler(ngCompilerHost, { | ||
translations: transContent, | ||
i18nFormat: cliOptions.i18nFormat, | ||
locale: cliOptions.locale, | ||
locale: cliOptions.locale, missingTranslation: missingTranslation, | ||
enableLegacyTemplate: options.enableLegacyTemplate !== false, | ||
@@ -64,0 +79,0 @@ genFilePreamble: PREAMBLE, |
@@ -12,2 +12,3 @@ import { AngularCompilerOptions } from '@angular/tsc-wrapped'; | ||
locale?: string; | ||
missingTranslation?: string; | ||
readResource: (fileName: string) => Promise<string>; | ||
@@ -14,0 +15,0 @@ } |
@@ -57,2 +57,3 @@ /** | ||
locale: options.locale, | ||
missingTranslation: options.missingTranslation, | ||
basePath: options.basePath | ||
@@ -59,0 +60,0 @@ }; |
@@ -18,3 +18,3 @@ /** | ||
*/ | ||
exports.VERSION = new core_1.Version('4.1.1'); | ||
exports.VERSION = new core_1.Version('4.2.0-beta.0'); | ||
//# sourceMappingURL=version.js.map |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
142925
1.57%1359
1.27%1
Infinity%+ Added
+ Added
+ Added
- Removed
- Removed
- Removed