2
2

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.

gulp-stylusで"resolve url"の設定

Last updated at Posted at 2014-08-14

grunt-stylusだと簡単に"resolve url"の設定が出来たのですが、gulp-stylusではなかなか出来なかったのでメモ。

gulp = require("gulp")
plugins = require("gulp-load-plugins")()
stylus = require("stylus")

gulp.task "stylus", ->
	gulp.src(["./**/*.styl?(us)", "!./**/_*.styl?(us)", "!./node_modules/**"])
		.pipe plugins.stylus(
			"resolve url": true
			define: {'url': stylus.resolver()}
		)
		.pipe gulp.dest("./")

結果見ると別に難しくもなんとも無いのですが
define: {'url': stylus.resolver()}
を設定しなきゃってことに気がつくのにかなり時間を費やしてしましました...

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?