(前提: yeomanにてgenerator bootstrap lessを利用し、初期セットアップ終了後)
Gruntfile.jsに以下のような記述を行う
Gruntfile.js
less: {
dist: {
files: {
//変数yeoman.appはGruntfile内で別途指定
'<%= yeoman.app %>/styles/main.css': ['<%= yeoman.app %>/styles/*.less']
},
options: {
sourceMap: true,
sourceMapFilename: '<%= yeoman.app %>/styles/main.css.map',
sourceMapBasepath: '<%= yeoman.app %>/',
sourceMapRootpath: '/'
}
}
},
上記の指定を行うと、/styles/フォルダ以下の*.lessファイルがすべてmain.cssとしてコンパイルされる。
grunt serverでライブリロード時にも有効。