Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): allow linker JIT support with pre…
Browse files Browse the repository at this point in the history
…bundling with esbuild builder

When using prebundling with the Vite-based development server, the Angular linker will now
correctly emit JIT module scope information. This information is required in JIT mode for
NgModules to successfully be used in an application.

(cherry picked from commit a6c06c4)
  • Loading branch information
clydin committed Jun 23, 2023
1 parent d0a593b commit 8108b8c
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,10 @@ export async function setupServer(
name: 'angular-vite-optimize-deps',
setup(build) {
const transformer = new JavaScriptTransformer(
{ sourcemap: !!build.initialOptions.sourcemap },
// Always enable JIT linking to support applications built with and without AOT.
// In a development environment the additional scope information does not
// have a negative effect unlike production where final output size is relevant.
{ sourcemap: !!build.initialOptions.sourcemap, jit: true },
1,
);

Expand Down

0 comments on commit 8108b8c

Please sign in to comment.