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

7.2 - new bundles.json #7669


User avatar
0
XugoWebTeam created

Hi,

we've just upgraded to 7.2. ASP>NET Core Angular)

I've see you've introduced a new bundles.json file. I have a question about LESS compilation. In your docs it says:

You can also use less files in the input section of your style bundles. ASP.NET Zero converts the less file into css and adds it to bundle.

I've given this a try - I created a file called src/assets/common/styles/metronic-customize.less and made an entry in bundles.json like this:

<span class="colour" style="color: rgb(230, 230, 230);">    {</span> <span class="colour" style="color: rgb(230, 230, 230);"></span><span class="colour" style="color: rgb(156, 220, 254);">"output"</span><span class="colour" style="color: rgb(230, 230, 230);"></span><span class="colour" style="color: rgb(206, 145, 120);">"src/assets/common/styles/metronic-customize.min.css"</span><span class="colour" style="color: rgb(230, 230, 230);">,</span> <span class="colour" style="color: rgb(230, 230, 230);"></span><span class="colour" style="color: rgb(156, 220, 254);">"input"</span><span class="colour" style="color: rgb(230, 230, 230);">: [</span> <span class="colour" style="color: rgb(230, 230, 230);"></span><span class="colour" style="color: rgb(206, 145, 120);">"src/assets/common/styles/metronic-customize.less"</span> <span class="colour" style="color: rgb(230, 230, 230);">      ]</span> <span class="colour" style="color: rgb(230, 230, 230);">    },</span>

However the compilation isn't happening. Am i not understanding something correctly?


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

    hi @xugowebteam

    I have not reproduced the problem you encountered.

  • User Avatar
    0
    XugoWebTeam created

    Hi @maliming

    thanks for testing that. I will have another try today.

    just to clarify - your test.min.css is being generated/updated when you save your less file? or do you have to run gulp buildDev? or is it npm start?

    i think i was using ng serve

  • User Avatar
    0
    maliming created
    Support Team

    You need to execute the command provided by zero. Such as:

    npm run start
    npm run create-dynamic-bundles
    

    Actually it is executing the gulp buildDev command.

  • User Avatar
    0
    XugoWebTeam created

    Hey @maliming

    Both of those commands are throwing an 'invalid glob agument' error for me.

    any idea?

    fyi - I am on Mac, (however that shouldnt be an issue for npm or gulp)

  • User Avatar
    0
    maliming created
    Support Team

    Can you share the contents of your gulpfile.js?

    What is the full path to your source code? see: https://github.com/aspnetzero/aspnet-zero-core/issues/2554

  • User Avatar
    0
    XugoWebTeam created

    Hi @maliming

    (sorry for the very slow reply, as ive only just revisited it)

    I do now have this compiling, but only by manually running the npm start command whenever i want to compile. Do you know if this can be incorporated into the 'file watching' that occurs when you run ng serve?

    In other words...when you save a file, all the LESS is automatically compiled?

  • User Avatar
    0
    maliming created
    Support Team

    It seems that can only use the commands I mentioned above.

    https://support.aspnetzero.com/QA/Questions/7669#answer-4de94d9e-891e-726f-a63a-39f0544e0e9d

  • User Avatar
    0
    ismcagdas created
    Support Team

    This issue is closed because of no recent activity. Please open a new issue if you are still having this problem.