with the following folder structure:
Both main.less and the my-theme.less @import the _some-mixin.less file via @import "_some-mixin" and @import "../some-import", respectively.
If I dotless.Compiler ./main.less --watch everything works great. It finds the _some-mixin.less file and also watches it, recompiling main.less when I change either main or _some-mixin.
dotless.Compiler ./main.less --watch
Now do dotless.Compiler ./theme/my-theme.less --watch and it again finds the files and starts watching them. Changing the my-theme.less works and it gets re-compiled. However, changing the _some-mixin.less file fails with:
dotless.Compiler ./theme/my-theme.less --watch
Unhandled Exception: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at dotless.Compiler.Watcher.FileChangedHandler(Object sender, FileSystemEventArgs e)
at System.IO.FileSystemWatcher.OnChanged(FileSystemEventArgs e)
at System.IO.FileSystemWatcher.NotifyFileSystemEventArgs(Int32 action, String name)
at System.IO.FileSystemWatcher.CompletionStatusChanged(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* overlappedPointer)
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
Are relative imports allowed? I would assume so because compiling the my-theme.less file directly works, its just --watch that barfs.
I could reproduce this on my machine and am looking into it..
Fixed it in 5208ce6
The problem was that the LessEngine returns foward slashes as imports because that's how the handler presents stuff to the web.
The Console Compiler does require backward slashes though.
I fixed this with a Decorator on the LessEngine so I don't screw up the handler implementation.