Open filipesilva opened 3 years ago
I have been facing the same issue and the PR attached above fixed it for me. The basis for change was this line in LESS documentation
If it does not have an extension, .less will be appended and it will be included as a imported Less file.
Link: https://lesscss.org/features/#import-atrules-feature-file-extensions
@jonycheung Let me know if it works.
Which version are you using (less-watch-compiler --version to find out)? 1.14.6
Is the issue reproducible after updating to the latest version ( npm update less-watch-compiler)? yes
Describe the bug The LESS docs say that the
.less
extension is optional on imports.But
less-watch-compiler
will throw an exception when it encounters such imports under very specific circumstances:less-watch-compiler
is ran on watch modeTo Reproduce Steps to reproduce the behavior:
My folder setup is
The
less/bem/block/file.less
andless/color.less
files are empty. The content ofless/site.less
is@import "color";
.The command I ran is
yarn less-watch-compiler less css site.less
Something went wrong... What is it?
Actual behavior
less-watch-compiler
throws an error:Expected behavior Should compile less files successfully.
Desktop (please complete the following information):
Additional context Using the
--run-once
flag will make it compile sucessfully.Using the
@import "color.less";
will make it compile sucessfully.Removing the
less/bem/block
folder and leaving behind an emptyless/bem
folder will also make it compile sucessfully.