Search code examples
angularwebpackangular2-universalwebpack-2

How to enable minification in universal-starter?


How to enable minification for angular/universal-starter?

Right now the browser loads a 3.4MB index.js file:

enter image description here

Is enableProdMode responsible for minification?

If yes, universal-starter does have enableProdMode in server.ts and client.ts now.

If not, how to enable minification? Thanks


Solution

  • I got a response from @mekya on GitHub.

    npm run build:prod
    

    which uses:

    webpack --progress -p
    

    inside of package.json file.

    And track this on GitHub for more info.