node-less-chokidar icon indicating copy to clipboard operation
node-less-chokidar copied to clipboard

How can I compile multiple less files into one css file?

Open zhaoyi0113 opened this issue 7 years ago • 1 comments

I am using below scripts to compile less files:

"build-css": "node-less-chokidar src/scenes -o src/scenes",
"watch-css": "yarn run build-css && node-less-chokidar src/scenes -o src/scenes --watch --recursive",

I will compile each less file to one css file. I wonder whether there is a way for me to compile all less files into one big css file.

zhaoyi0113 avatar Mar 16 '18 12:03 zhaoyi0113

@zhaoyi0113 You can solve this by importing all the other less files in a new file, and when you compile that, it will contain all the rules from every less file it imports.

Problem is that this module doesn't support "intelligent" crawling of the less file graph, so it won't detect changes in the file that imports every file. I'm thinking about an easy solution and will try to find some time to fix it. This solution only works for the build-css option.

sampi avatar Jul 18 '18 16:07 sampi