I create i18n files using ng-xi18n tool. When I execute "./node_modules/.bin/ng-xi18n"
messages.xlf file is created. The problem is that all code is compiled. js, js.map, metadata.json files are created, I don't need them. Hoe to create messages.xlf without js, js.map and metadta.json files?
Here is my tsconfig.json:
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"sourceMap": true,
"noEmitHelpers": true,
"strictNullChecks": false,
"baseUrl": "./src",
"paths": {
},
"lib": [
"dom",
"es6"
],
"types": [
"hammerjs",
"jasmine",
"node",
"protractor",
"selenium-webdriver",
"source-map",
"uglify-js",
"webpack"
]
},
"exclude": [
"node_modules",
"dist"
],
"awesomeTypescriptLoaderOptions": {
"forkChecker": true,
"useWebpackText": true
},
"compileOnSave": false,
"buildOnSave": false,
"atom": { "rewriteTsconfig": false }
}
This is actually an open issue in the tool:
https://github.com/angular/angular/issues/13567
As a workaround, I've implemented an npm script to run
ng-xi18n
and then remove the generated files.In your
package.json
add the followingscripts
section:Then you can issue
npm run i18n
to perform the extraction and cleanup.Notes:
ClientApp
folder at the root of the project folder, hence I'm targeting the deletions starting from that folder.Hope that helps until the bug gets fixed.
Cheers!