PowerShell script add '--prod' argument to build Angular CLI project

Discussão em 'Angular' iniciado por Andrei, Janeiro 1, 2025.

  1. Andrei

    Andrei Guest

    I am creating PowerShell script to automatically build Angular CLI project. When I use this command in my .ps1 file:

    Start-Process -FilePath ng build -WorkingDirectory D:\pathToAngularProject -Wait


    it works perfectly but create not uglified javascript build. To be able to create production build I need to add '--prod' argument. But when I change example above on :

    Start-Process -FilePath ng build -ArgumentList '--prod' -WorkingDirectory D:\pathToAngularProject -Wait


    I am getting the error: [​IMG]

    Does anyone have a suggestion how can I add an argument to 'ng build' command in PowerShell script?

    Continue reading...

Compartilhe esta Página