Skip to content

Conversation

brandonroberts
Copy link
Member

PR Checklist

Closes #

What is the new behavior?

Adds support for file replacements to the analog and vite-plugin-angular plugins. File replacements can also be configured per environment, so client/SSR-specific replacements can be configured.

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

// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
  return {
    plugins: [
      analog({
        fileReplacements:
          mode === 'production'
            ? [
                {
                  replace: 'src/environments/environment.ts',
                  with: 'src/environments/environment.prod.ts',
                },
                {
                  replace: 'src/app/pages/shipping/shipping-service.ts', // client-only service
                  ssr: 'src/app/pages/shipping/shipping-service-server.ts', // server-only service
                },
              ]
            : [
                {
                  replace: 'src/app/pages/shipping/shipping-service.ts', // client-only service
                  ssr: 'src/app/pages/shipping/shipping-service-server.ts', // server-only service
                },
              ],
      }),
    ]
  };
});

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

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

Copy link

netlify bot commented Sep 10, 2025

Deploy Preview for analog-blog ready!

Name Link
🔨 Latest commit 8556520
🔍 Latest deploy log https://app.netlify.com/projects/analog-blog/deploys/68c2cb9725f5a90008cef18c
😎 Deploy Preview https://deploy-preview-1871--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.

Copy link

netlify bot commented Sep 10, 2025

Deploy Preview for analog-ng-app ready!

Name Link
🔨 Latest commit 8556520
🔍 Latest deploy log https://app.netlify.com/projects/analog-ng-app/deploys/68c2cb96c67a020008bf0c07
😎 Deploy Preview https://deploy-preview-1871--analog-ng-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.

Copy link

netlify bot commented Sep 10, 2025

Deploy Preview for analog-app ready!

Name Link
🔨 Latest commit 8556520
🔍 Latest deploy log https://app.netlify.com/projects/analog-app/deploys/68c2cb9707364500086c4b38
😎 Deploy Preview https://deploy-preview-1871--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.

Copy link

netlify bot commented Sep 10, 2025

Deploy Preview for analog-docs ready!

Name Link
🔨 Latest commit 8556520
🔍 Latest deploy log https://app.netlify.com/projects/analog-docs/deploys/68c2cb962651fe000854fba3
😎 Deploy Preview https://deploy-preview-1871--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.

@brandonroberts brandonroberts merged commit 62f9a2d into beta Sep 11, 2025
22 checks passed
@brandonroberts brandonroberts deleted the feat-file-replacements branch September 11, 2025 13:32
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.

1 participant