Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Building Angular for production and minification problem #4726


User avatar
0
abdourahmani created

It's said that

ng build --prod --base-href "./"

will build angular for production. But for me it fails with this error : [attachment=1:bid928af]error build prod.png[/attachment:bid928af]

Am I incorrectly adding this component ?

instead, this command

ng build --env=prod --base-href "./"

runs to completion. But it produce larges files : [attachment=0:bid928af]dist directory.png[/attachment:bid928af]

What am I doing wrong ?

(Angular 5 + Dot core 2, v5.1.0)

Best regards, Abdourahmani


8 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Can you try with "ng build --prod" ?

    Thanks.

  • User Avatar
    0
    abdourahmani created

    It gives the same error.

    [attachment=0:2fgg3y4t]same error.png[/attachment:2fgg3y4t]

  • User Avatar
    0
    alper created
    Support Team

    hi

    check out <a class="postlink" href="https://github.com/angular/material2/issues/8070#issuecomment-341312300">https://github.com/angular/material2/is ... -341312300</a>

  • User Avatar
    0
    abdourahmani created

    Hi @ alper,

    Thank you for your message.

    I don't have a "tsconfig.app.json" file but "tsconfig.json". And there is no "rootDir" in it.

    Regards.

  • User Avatar
    0
    ismcagdas created
    Support Team

    @abdourahmani what is your primeng version ?

  • User Avatar
    0
    abdourahmani created

    Hi @ismcagdas

    I'm using Angular 5 + Dot core 2, v5.1.0 . I didn't change any thing.

    Just added p-progressBar in my project. And it runs ok in developement.

    The problem occurs just when I try to build for production.

    With this command

    ng build --env=prod --base-href "./"
    

    the project build fine but with larger output files (see my first post explorer capture), so without minification.

    With this command

    ng build --prod --base-href "./"
    

    , I've got the above mentioned error.

    Regards.

  • User Avatar
    0
    ismcagdas created
    Support Team

    @abdourahmani Thanks for the information. I will check it in a short time.

  • User Avatar
    0
    ismcagdas created
    Support Team

    @abdourahmani couldn't reporduce this problem. Can you share your angular client project via email ? Please send it to <a href="mailto:[email protected]">[email protected]</a>.

    Thanks.