Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom webpack @ extract-i18n | Angular 10.1 #659

Closed
julkue opened this issue Jan 14, 2020 · 8 comments · Fixed by #832
Closed

Custom webpack @ extract-i18n | Angular 10.1 #659

julkue opened this issue Jan 14, 2020 · 8 comments · Fixed by #832

Comments

@julkue
Copy link

julkue commented Jan 14, 2020

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.

@just-jeb
Copy link
Owner

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.

@just-jeb
Copy link
Owner

FYI, it's in progress: angular/angular-cli#16759.

@julkue
Copy link
Author

julkue commented Jan 26, 2020

Great!

Related issue: angular/angular-cli#16679

@just-jeb
Copy link
Owner

just-jeb commented Jan 27, 2020

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 just-jeb pinned this issue Jan 27, 2020
@julkue julkue changed the title Custom webpack @ extract-i18n | Angular 8 Custom webpack @ extract-i18n | Angular 8 & 9 Jun 8, 2020
@janousek
Copy link

janousek commented Sep 3, 2020

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

@just-jeb just-jeb removed the blocked label Sep 3, 2020
@just-jeb just-jeb changed the title Custom webpack @ extract-i18n | Angular 8 & 9 Custom webpack @ extract-i18n | Angular 10.1 Sep 3, 2020
@just-jeb
Copy link
Owner

just-jeb commented Sep 3, 2020

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

@just-jeb
Copy link
Owner

just-jeb commented Sep 6, 2020

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

@julkue
Copy link
Author

julkue commented Sep 6, 2020

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.

@just-jeb just-jeb unpinned this issue Sep 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants