-->

LESS strictImports

2020-07-24 04:58发布

问题:

I have a build that compiles several less files (all are actually imported into one master.less file). One of the options for the build is strictImports which suggests that it forces the evaluation of imports. Does anyone know if this have to do with operations in imported files, or am I completely missing the point?

回答1:

The strictImports controls whether the compiler will allow an @import inside of either @media blocks or (a later addition) other selector blocks. See some of the comments from this closed issue with regards to that.

So with it set to true these are not allowed:

@media screen {
   @import somefile.less;
}
.mySelector {
   @import somefile.less;
}


标签: import less