Open brainz80 opened 3 years ago
Thanks for issue report, we will investigate it later.
@brainz80 It looks like work as expected.
https://cdn.jsdelivr.net/npm/bootstrap@3.4.1/less/mixins/grid-framework.less
.loop-grid-columns(@index, @class, @type) when (@index >= 0) { .calc-grid-column(@index, @class, @type); // next iteration .loop-grid-columns((@index - 1), @class, @type); }
which is weird because of it having a when -guard operator.
Not weird, If a loop no when
guard, we will get a infinite loop.
Ok, managed to figure out what the problem is.
Here's a simple setup:
main.less:
@import 'module1.less';
@import 'module2.less';
module1.less:
.iterate(@index) when (@index >= 0) {
&.item-@{index} {
color: rgb(255 - @index, 0, 0);
}
.iterate(@index - 1);
}
b {
.iterate(10);
}
module2.less:
.iterate(@index) when (@index >= 0) {
&.item-@{index} {
color: rgb(255 - @index, 0, 0);
}
.iterate(@index - 1);
}
a {
.iterate(20);
}
the problem is that both module1.less and module2.less define the mixin .iterate()
. The same thing happens with Bootstrap and AdminLTE. AdminLTE uses a bundled version of Bootstrap and therefore overrides the one imported by:
@import "~bootstrap/less/bootstrap.less";
I'm not sure if this should be the desired result. Maybe the later definition of .iterate()
should take precedence?
@brainz80 Thanks for detailed description, more clear for me.
I'm trying to bundle
admin-lte@2.4.18
andbootstrap@3.4.1
withless@4.1.1
viawebpack@5.39.0
.My
webpack.config.js
looks like this:and my
main.less
like this:When I try to build my project I get:
There doesn't seem to be any way of debugging this. But what I managed to figure out is that LESS seems to get stuck in an endless loop in
~bootstrap/less/mixins/grid-framework.less
. This mixin seems to be the culprit:which is weird because of it having a
when
-guard operator.