MVC4 Less Bundle @import Directory

前端 未结 10 828
南方客
南方客 2020-12-12 17:02

I\'m trying to use MVC4 bundling to group some of my less files, but it looks like the import path I\'m using is off. My directory structure is:

static/
             


        
10条回答
  •  遥遥无期
    2020-12-12 17:53

    The issue is that the DynamicFolderBundle reads all the contents of the files and passes the combined contents to the LessMinify.

    As such any @imports have no reference to the location the file came from.

    To resolve this I had to place all the "less" files into one location.

    Then you have to understand the ordering of the files become important. As such I started to rename the file with a number (eg: "0 CONSTANTS.less", "1 MIXIN.less" which means that they are loaded at the top of the combined output before they go into the LessMinify.

    if you debug your LessMinify and view the response.Content you will see the combined less output!

    Hope this helps

提交回复
热议问题