xi18n extraction should be based on code referenced/entrypoints
See original GitHub issueBug Report or Feature Request (mark with an x
)
- [x] bug report -> please search issues before submitting
- [ ] feature request
Versions.
Angular CLI: 1.5.0
Node: 8.7.0
OS: darwin x64
Angular: 5.0.0
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
@angular/cli: 1.5.0
@angular-devkit/build-optimizer: 0.0.32
@angular-devkit/core: 0.0.20
@angular-devkit/schematics: 0.0.35
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.8.0
@schematics/angular: 0.1.1
typescript: 2.4.2
webpack: 3.8.1
Repro steps.
Use monorepos pattern for having multiple apps and libs and then extract strings for each app. They all contain references to all strings whether used or not.
Command: https://github.com/intellix/nx-cli/blob/master/package.json#L13
References to strings in other apps: https://github.com/intellix/nx-cli/blob/master/apps/red/src/locale/messages.xlf#L26
References to lazy module that’s not used/referenced by that app: https://github.com/intellix/nx-cli/blob/master/apps/red/src/locale/messages.xlf#L77
Desired functionality.
I’d like extraction (and pretty much everything through ngc) to only be based on context of the app and it’s entrypoints (static or lazy). In the example repository, the Red app doesn’t reference or have a loadChildren reference to LazierModule but still gets strings extracted for it and all the other apps.
We’ve got feature modules defined as libs and a couple of apps that include some of them. The product owners of apps are confused why they’re translating strings for features they don’t have and for other apps
Mention any other details that might be useful.
Schematics: https://nrwl.io/nx/ Repository: https://github.com/intellix/nx-cli
Issue Analytics
- State:
- Created 6 years ago
- Reactions:6
- Comments:6 (5 by maintainers)
I think this is a non-issue now that CLI uses a workspace file and can have several distinct applications, each of them with its own tsconfig files. Let me know if that’s not the case.
Nice, fyi you can extend another tsconfig file instead of copy pasting everything in each file. If you only need to change the exclude, it’s easier to have a generic app config file, extend it and just change that