It seems that the current version of less-brunch is broken with the current version of brunch. I have found the cause of the bug and got a fix that works on my machine, but I don't know enough about brunch internals to know if this is the right fix.
To reproduce, create any brunch project and try to build it:
npm install -g brunch
mkdir bug-demo
cd bug-demo
brunch new gh:brunch/dead-simple
npm install --save less-brunch
touch app/style.less
brunch build
Results in the following error
TypeError: Cannot read property 'regexp' of undefined
at LESSCompiler.progeny [as getDependencies] (/Users/bernie/Documents/Projects/bug-demo/node_modules/less-brunch/node_modules/progeny/lib/index.js:182:19)
at getDependencies (/usr/local/lib/node_modules/brunch/lib/fs_utils/pipeline.js:40:23)
... 15 more lines ...
The problem is this line in less-brunch's index.js on line 12:
brunch expectsgetDependencies to be a function(data, path, callback) but progeny provides a function(path, source, callback), so it tries to treat the LESS script content as a file path and dies.
I resolved the issue on my machine by deleting the line. This works for my project, but I assume I must have broken something.
It seems that the current version of less-brunch is broken with the current version of brunch. I have found the cause of the bug and got a fix that works on my machine, but I don't know enough about brunch internals to know if this is the right fix.
To reproduce, create any brunch project and try to build it:
Results in the following error
The problem is this line in less-brunch's index.js on line 12:
brunch expects
getDependencies
to be afunction(data, path, callback)
but progeny provides afunction(path, source, callback)
, so it tries to treat the LESS script content as a file path and dies.I resolved the issue on my machine by deleting the line. This works for my project, but I assume I must have broken something.
A more appropriate fix might be something like: