简体   繁体   中英

Using less-middleware to compile multiple source CSS files into one?

In my Node.js application, I am using less-middleware to compile the LESS files into CSS files. Works great with single files:

app.use(require('less-middleware')({ src: path.join(__dirname, '../', '/public/css') }));

However, I was wondering if it were possible to take two source .less files, and compile (and optinally minify) them into one single .css file.

Got it working using @import :

style.less

... LESS code...

style2.less

... more LESS...

combined.less

@import "style";
@import "style2";

via Join two .less files into one css file

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM