Skip to content

Conversation

@brandonroberts
Copy link
Member

PR Checklist

Closes #1955

What is the new behavior?

Support for using Angular's Compilation API is added under an experimental flag while the integration is stabilized. The compilation API gets feature and performance improvements, and supports parallel compilation through an environment variable.

When enabled, the Angular Compilation API is used to compile TypeScript files instead of manually constructing an instance of the Angular Compiler.

/// <reference types="vitest" />

import { defineConfig } from 'vite';
import analog from '@analogjs/platform';

// https://vitejs.dev/config/
export default defineConfig(({ mode }) => ({
  build: {
    target: ['es2020'],
  },
  resolve: {
    mainFields: ['module'],
  },
  plugins: [
    analog({
      vite: {
        experimental: {
          useAngularCompilationAPI: true
        }
      }
    })
  ],
  test: {
    globals: true,
    environment: 'jsdom',
    setupFiles: ['src/test-setup.ts'],
    include: ['**/*.spec.ts'],
    reporters: ['default'],
  },
  define: {
    'import.meta.vitest': mode !== 'production',
  },
}));

TODO:

  • Add support for liveReload
  • Add support for fileReplacements
  • Add support for building libraries

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

[optional] What gif best describes this PR or how it makes you feel?

@netlify
Copy link

netlify bot commented Nov 18, 2025

Deploy Preview for analog-docs ready!

Name Link
🔨 Latest commit 3adfd0d
🔍 Latest deploy log https://app.netlify.com/projects/analog-docs/deploys/691cee85d7946e00086c1188
😎 Deploy Preview https://deploy-preview-1957--analog-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Nov 18, 2025

Deploy Preview for analog-blog ready!

Name Link
🔨 Latest commit 3adfd0d
🔍 Latest deploy log https://app.netlify.com/projects/analog-blog/deploys/691cee859e404a000865cfad
😎 Deploy Preview https://deploy-preview-1957--analog-blog.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Nov 18, 2025

Deploy Preview for analog-app ready!

Name Link
🔨 Latest commit 3adfd0d
🔍 Latest deploy log https://app.netlify.com/projects/analog-app/deploys/691cee857b38f700080665a8
😎 Deploy Preview https://deploy-preview-1957--analog-app.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@brandonroberts brandonroberts force-pushed the feat-angular-compilation-api branch from e7e1652 to 3adfd0d Compare November 18, 2025 22:09
@brandonroberts brandonroberts merged commit 51cf433 into beta Nov 19, 2025
18 checks passed
@brandonroberts brandonroberts deleted the feat-angular-compilation-api branch November 19, 2025 03:54
@benpsnyder
Copy link
Contributor

Results in our repo:

BEFORE

nx run marketos-edge-gui-adastra:build --skip-nx-cache 369.59s user 34.94s system 310% cpu 2:10.33 total
nx run marketos-edge-gui-adastra:build --skip-nx-cache 364.16s user 34.32s system 307% cpu 2:09.53 total

nx run meritos-edge-gui-portal:build --skip-nx-cache 302.98s user 24.32s system 393% cpu 1:23.25 total
nx run meritos-edge-gui-portal:build --skip-nx-cache 301.86s user 23.19s system 400% cpu 1:21.11 total

AFTER

nx run marketos-edge-gui-adastra:build --skip-nx-cache 377.33s user 32.81s system 360% cpu 1:53.85 total
nx run marketos-edge-gui-adastra:build --skip-nx-cache 376.99s user 32.71s system 357% cpu 1:54.54 total

nx run meritos-edge-gui-portal:build --skip-nx-cache 301.46s user 23.37s system 398% cpu 1:21.49 total
nx run meritos-edge-gui-portal:build --skip-nx-cache 304.82s user 23.98s system 399% cpu 1:22.22 total

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for Angular Compilation API to vite plugin

3 participants