Skip to content

Instantly share code, notes, and snippets.

@gaspanik
Last active January 2, 2016 18:19
Show Gist options
  • Save gaspanik/8343253 to your computer and use it in GitHub Desktop.
Save gaspanik/8343253 to your computer and use it in GitHub Desktop.
gulpjsの始め方。

gulp.js

gulp.js - the streaming build system

npm install gulp -g

gulp plugins

npm install gulp gulp-util gulp-jade --save-dev

「gulpfile.js」を作る。

sample gulpfile.js

「src/hoge.jade」を「dest/hoge.html」に変換。ついでに監視。

var gulp = require('gulp')
,	gutil = require('gulp-util')
,	jade = require('gulp-jade');

gulp.task('jade', function() {
	return gulp.src('src/*.jade')
		.pipe(jade())
		.pipe(gulp.dest('dest'));
});

gulp.task('default', function() {
	gulp.run('jade');
	gulp.watch('src/**', function() {
		gulp.run('jade');
	});
});

run task

gulp

そんだけ。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment