2014-08-15 22:04:51 +00:00
|
|
|
var gulp = require( 'gulp' ),
|
|
|
|
stylus = require( 'gulp-stylus' ),
|
|
|
|
nib = require( 'nib' ),
|
|
|
|
watch = require( 'gulp-watch' ),
|
|
|
|
vulcan = require( 'gulp-vulcanize' );
|
|
|
|
|
|
|
|
var paths = {
|
|
|
|
style: './elements/*.styl'
|
2014-08-15 16:32:49 +00:00
|
|
|
}
|
|
|
|
|
2014-08-15 22:04:51 +00:00
|
|
|
function compileCSS( files ) {
|
|
|
|
return files
|
|
|
|
.pipe( stylus( { use: [ nib() ] } ) )
|
|
|
|
.pipe( gulp.dest( './elements/' ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
gulp.task( 'default', function() {
|
|
|
|
|
|
|
|
compileCSS( gulp.src( paths.style ) );
|
|
|
|
|
|
|
|
gulp.src( './index.html' )
|
|
|
|
.pipe( vulcan( {
|
|
|
|
dest: 'build',
|
|
|
|
inline: true,
|
|
|
|
strip: true
|
|
|
|
} ) );
|
|
|
|
|
|
|
|
|
|
|
|
} );
|
|
|
|
|
|
|
|
gulp.task( 'watch', function() {
|
|
|
|
watch( { glob: paths.style }, compileCSS );
|
|
|
|
} );
|