I'm experimenting with yeoman.
I want to integrate less into my yeoman or grunt build. But I haven't found I simple way to do it.
I do have found to yeoman-less repository which refers to grunt-contrib-less. But that plugin is quite hard to plugin if you are new to yeoman and grunt. Isn't there a much easier way to plugin less into my yeoman webapp so the less commands are automatically added to the grunt build file?
Thanks for the tips and tricks!
Released in 2012, Yeoman is an efficient open-source software system for scaffolding web applications, used for streamlining the development process. It is known primarily for its focus on scaffolding, which means the use of many different tools and interfaces coordinated for optimized project generation.
Yeoman is an open source client-side scaffolding tool for web applications. Yeoman runs as a command-line interface written for Node.
gulp belongs to "JS Build Tools / JS Task Runners" category of the tech stack, while Yeoman can be primarily classified under "Front End Scaffolding Tools". Some of the features offered by gulp are: By preferring code over configuration, gulp keeps simple things simple and makes complex tasks manageable.
Assuming that you scaffold out a new app using yo webapp
and answer both questions with No
, your best choice for integrating LESS is grunt-recess which you need to install first:
npm install --save-dev grunt-recess
If you dislike the linting rules, you can customize them. Feel free to uninstall grunt-compass
and remove it from the package.json
.
You then need to replace the compass
task in the Gruntfile with this:
recess: {
options: {
compile: true
},
dist: {
files: [{
expand: true,
cwd: '<%= yeoman.app %>/styles',
src: '{,*/}*.less',
dest: '.tmp/styles/',
ext: '.css'
}]
}
}
You then need to replace all remaining references to the compass
task with recess
, so that the resulting Gruntfile looks like this one.
This is an old question, but I keep finding it. So, here is an up-to-date answer:
Use the "LessApp" generator for Yeoman, found here: https://github.com/robinpokorny/generator-lessapp
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With