AngularCli: disable minification

后端 未结 4 1216
无人及你
无人及你 2020-12-07 00:25

Is there a way to disable the minification in AngularCli?

After I launch the command ng build --prod I need to have all files.js, in dist folder, separa

相关标签:
4条回答
  • 2020-12-07 00:51

    Just do:

    ng build --prod --optimization=false
    

    That seems to do it. For more information see: https://github.com/angular/angular-cli/wiki/build

    This is valid for angular 6.*

    0 讨论(0)
  • 2020-12-07 01:00

    Note: If you use ng serve through some package.json run target, according to the manpage of Angular6 correspoding switch for this is:

    ng serve --optimization=false

    will speedup this bs in development noticeable

    0 讨论(0)
  • 2020-12-07 01:08
    ng build --build-optimizer=false
    
    0 讨论(0)
  • 2020-12-07 01:10

    In order to get the plain and separate and un-minified js files you just need to compile them with typescript (tsc) to your dist directory.

    There is no need to use the cli build. By design Angular CLI bundles all javascript files when building.

    From the cli build documentation:

    All builds make use of bundling and limited tree-shaking, while --prod builds also run limited dead code elimination via UglifyJS.

    0 讨论(0)
提交回复
热议问题