3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[Grunt] 指定ディレクトリ以下の*.lessファイルをまとめてmain.cssとして出力させるには

Posted at

(前提: 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でライブリロード時にも有効。

全文は以下。https://gist.github.com/mekkoo/9927265

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?