Angular-builders: Custom webpack @ extract-i18n | Angular 10.1

Created on 14 Jan 2020  路  8Comments  路  Source: just-jeb/angular-builders

Is your feature request related to a problem? Please describe.

I know that there has already been a discussion on this topic here and it has been implemented in Angular 7 by @patnolanireland, but it's still missing in Angular 8.

I need to build my application with a custom webpack config to configure webpack alias (namespaces). Currently I can't use the Angular extract i18n process because I can't tell it to use my custom webpack config. Therefore, it'll fail.

This was already officially supported in Angular 7, according to the docs.

Describe the solution you'd like
Implement the possibility to specify a custom webpack config for extract-i18n.

custom-webpack enhancement pr-welcome regression

All 8 comments

Hi @julmot, thanks for bringing it up.
The reason it's not supported in versions 8 & 9 is that the extension mechanism should be supported in extract-i18n builder itself first.
In Angular CLI 7 builders were classes and one could just override the method for Webpack config generation. Since Angular 8 the things have changed and there is a much stricter way to extend default builders. The way to do that is to pass transformers option but the builder has to support it.

As for now the extract-i18n builder is not supporting it but according to the guys from Angular team:

I don't see any reason why we cannot add webpackTransformer in i18n as well.

The required change is really small (like 3 lines of code), similarly to karma builder one should pass in the transformer and apply it if exists.
Once the change is in place I can bring the custom webpack extract-i18n back.

I totally agree it should be supported, however I'm not sure when I'll be able to take it. So if you want to speed things up I'd suggest you to create a PR to Angular CLI repo. As I mentioned the required change is really small.

Whether you take it or not this feature request will be blocked until the transformer is supported in Angular.

Another update (from Angular team):

I don't think it can be on 9.0 since its a feature, but it will be on 9.1.0-beta that will be released right after 9.0 final

So you can expect it soon after 9.1.0-beta is out.

@just-jeb Any update on this? Angular 10.1.0 is already out and the webpackTransformer is included.

Can't commit on a specific date but it's one of the top priorities now. As always, PRs are welcome.

@julmot @janousek please check out #832 (in particular the docs) and see if it serves your use case.

Unfortunately I can't anymore. After this has been idle from the ng team for so long, I've refactored my build process to avoid custom webpack configurations.

Was this page helpful?
0 / 5 - 0 ratings