5
5

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でcompassを複数ディレクトリでそれぞれコンパイル

Last updated at Posted at 2014-02-14

メモ書き。

example.com/css
example.com/scss
example.com/下層/css
example.com/下層/scss

があるとする。同一案件なので一括でコンパイルさせたいんだよー。

example.com/Gruntfile.js
example.com/config.rb
example.com/下層/config.rb
を用意。

上層下層の文字は適当に入れ替えてください。

Gruntfile.js

module.exports = function(grunt) {
	grunt.initConfig({
		compass: {
			上層: {
				options: {
					config: 'config.rb'
				}
			},
			下層: {
				options: {
					config: '下層/config.rb'
				}
			}
		}
	});
//~~~~
};

compass

上層config.rb

http_path = "/"
css_dir = "css"
sass_dir = "scss"
images_dir = "images"
javascripts_dir = "js"

output_style = :compact

line_comments = false
下層config.rb

http_path = "/"
css_dir = "下層/css"
sass_dir = "下層/scss"
images_dir = "下層/images"
javascripts_dir = "下層/js"

output_style = :compact

line_comments = false

あんまり考えずに作ったので、超適当。
config.rbも下層のconfig.rbから上層のを上手くインポートさせれば一元管理できるかもね。

5
5
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
5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?