CLI doesn't allow custom builder to pass additional extensions when building app for i18n extractions #27264
Labels
area: devkit/build-angular
devkit/build-angular:i18n
freq1: low
Only reported by a handful of users who observe it rarely
severity3: broken
type: bug/fix
Command
extract-i18n
Description
We're in the process of migrating from webpack to esbuild.
To provide custom esbuild plugins we decided to use custom builder (https://github.com/just-jeb/angular-builders).
It went smooth until we realised that
extract-i18
no longer works. It ends successfully butmessages.xlf
is empty.It turned out that angular checks
builderName
to choose which bundler to use.To fix that I decided to implement custom
extract-i18n
builder that will trickangular/cli
and force using esbuild -just-jeb/angular-builders#1711
For the record
nrwl/nx
did the same - nrwl/nx#21802The issue is that
angular/cli
will not let us pass any extensions during i18n application compilation.angular-cli/packages/angular_devkit/build_angular/src/builders/extract-i18n/application-extraction.ts
Line 59 in 1034bb1
It may lead to inconsistency between build and extract flow, which I suppose may lead to issues with i18n.
Describe the solution you'd like
We should be able to pass custom extensions as for regular app building.
(bonus) would be really nice if these
if (builderName === ...
are replaced by something that is custom builder friendly 🙏Describe alternatives you've considered
Alternatively we could rewrite whole
extract-i18n
builder, but as 95% of the code would be the same - it seems pointlessThe text was updated successfully, but these errors were encountered: