Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

Follow-up to issue: SSR: Add a way to configure externalDependencies for the server bundle only

Ouverte
#34,262 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
48/100
Type d'issue
Fonctionnalité
Clarté
Plutôt claire
Activité
Active
Stack technique
typescript
Domaine
build-system

Piste de recherche

Start from the application-builder option definitions where externalDependencies is declared (schema and option resolution under packages/angular/build), then locate where the server and browser esbuild configurations diverge. Note the report that dev builds and prod builds are configured differently — both paths must apply the new option. Done looks like a server-only externalization option that is accepted, applied only to the server bundle (e.g. graphql external on server, bundled in browser), and verified with an SSR build; API naming needs maintainer sign-off first.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

area: @angular/build
Command

build

Description

As title says, I'd like to follow-up on the unfortunately closed issue https://github.com/angular/angular-cli/issues/26487, requesting to configure externalDependencies independently for server and browser bundle.

Reading the mentioned issue, it has been closed because no particular value has been seen in being able to configure externalDependencies independently. However I'd like to point to a realistic and important case where such an option will be crucial.

Right now, we're still on using Webpack, which allows configuring externalDependencies explicitly for the server bundle, and that's the reason why it's not blocking us yet. But there's plans to eventually migrate to application-builder, however still a lot of obstacles ned to be solved, as like the mentioned lack of being able to define externalDependencies for server bundle only.

Our case is, we're using DataDog dd-trace for monitoring our server app infrastructure. dd-trace is being injected on runtime and requires all node packages doing downstream requests being external as otherwise it cannot properly trace them. See https://docs.datadoghq.com/tracing/trace_collection/dd_libraries/nodejs/#bundling

In our particular scenario, this applies to graphql package. We had to externalize it, as otherwise we wouldn't get logs for all requests towards our GraphQL API on server-side. But on the client-side using the browser-bundle we do not want graphql package being external, as there's absolutely no reason in it.

So, our particular needs can be properly served by using Webpack builder but with the current options for application-builder this isn't possible.

As a workaround I tried to implement a custom Esbuild plugin, which should reset the external dependencies just for the browser build. But due to the Angular build architecture this only works for a prod build but not for a development build. So I eventually dropped this idea, which anyway doesn't seem clean.

Hence I'd highly appreciate if you could change your mind in considering separate externalDependencies configurations for server and browser build.

Describe the solution you'd like

Being able to configure externalDependencies separately for server and browser build.

Describe alternatives you've considered

No response

Langage dominant
TypeScript
Étoiles
27k
Forks
11.8k
Merge moyen
1 j 2 min
PR mergées (30 j)
168

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de angular/angular-cli

Toutes les issues de angular/angular-cli

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.