iam-medvedev / esbuild-plugin-less

esbuild plugin for less files
https://npmjs.com/package/esbuild-plugin-less
Do What The F*ck You Want To Public License
43 stars 12 forks source link

Recursive imports crashes #114

Closed zouloux closed 4 months ago

zouloux commented 10 months ago

Hi :) Thanks for this plugin. I encountered this little bug on a project with circular dependencies. I assume the issue is in the recursive in the reduce, we may need a check if this dependency has already been discovered, and break the loop.

Expected Behavior

Build should not crash when 2 less files imports each others.

Actual Behavior

An infinite loop in starts in this code https://github.com/iam-medvedev/esbuild-plugin-less/blob/main/src/less-utils.ts

Steps to Reproduce the Problem

a.less imports b.less, b.less imports a.less It is a real use case when we load other less files as "reference" to have all exported mixins and variables, without importing the raw CSS from it.

Versions

iam-medvedev commented 4 months ago

Sorry for the long delay. Fixed in v1.3.7