2014-08-16 16:43:48 +00:00
|
|
|
/*
|
|
|
|
|
|
|
|
[ ] build without polymer bundled
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
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 = {
|
2014-08-16 16:43:48 +00:00
|
|
|
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() ] } ) )
|
2014-08-16 16:43:48 +00:00
|
|
|
.pipe( gulp.dest( 'elements' ) );
|
2014-08-15 22:04:51 +00:00
|
|
|
}
|
|
|
|
|
2014-08-16 16:43:48 +00:00
|
|
|
|
|
|
|
gulp.task( 'styles', function() {
|
2014-08-15 22:04:51 +00:00
|
|
|
|
|
|
|
compileCSS( gulp.src( paths.style ) );
|
|
|
|
|
2014-08-16 16:43:48 +00:00
|
|
|
} );
|
|
|
|
|
|
|
|
gulp.task( 'vulcanize', function() {
|
|
|
|
|
|
|
|
gulp.src( 'index.html' )
|
2014-08-15 22:04:51 +00:00
|
|
|
.pipe( vulcan( {
|
|
|
|
dest: 'build',
|
|
|
|
inline: true,
|
|
|
|
strip: true
|
|
|
|
} ) );
|
|
|
|
|
|
|
|
} );
|
|
|
|
|
|
|
|
gulp.task( 'watch', function() {
|
2014-08-16 16:43:48 +00:00
|
|
|
|
2014-08-15 22:04:51 +00:00
|
|
|
watch( { glob: paths.style }, compileCSS );
|
2014-08-16 16:43:48 +00:00
|
|
|
|
|
|
|
} );
|
|
|
|
|
|
|
|
|
|
|
|
gulp.task( 'default', [ 'styles', 'vulcanize' ]);
|