Open Closed

7.2 - new bundles.json #7669


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:

    { "output""src/assets/common/styles/metronic-customize.min.css", "input": [ "src/assets/common/styles/metronic-customize.less"       ]     },

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


7 Answer(s)
  • 0
    maliming created

    hi @xugowebteam

    I have not reproduced the problem you encountered.

    image.png

  • 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

  • 0
    maliming created

    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.

    image.png

  • 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)

    Screen Shot 2019-09-18 at 6.23.05 pm.png

  • 0
    maliming created

    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

  • 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?

  • 0
    maliming created

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

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