dat.gui/gulpfile.js

72 lines
1.4 KiB
JavaScript
Raw Normal View History

/*
2014-08-21 17:20:06 +00:00
[ ] build without platform bundled
*/
2014-08-15 22:04:51 +00:00
var gulp = require( 'gulp' ),
2014-08-22 02:36:49 +00:00
fs = require( 'fs' ),
$ = require( 'gulp-load-plugins' )( { 'pattern': '*' } );
2014-08-15 16:32:49 +00:00
2014-08-21 17:20:06 +00:00
var paths = {
main: 'gui.html',
css: 'elements/**/*.styl',
html: 'elements/**/*.html',
js: 'elements/**/*.js',
tests: 'tests/*'
2014-08-15 22:04:51 +00:00
}
2014-08-21 17:20:06 +00:00
gulp.task( 'css', function() {
2014-08-21 17:20:06 +00:00
gulp.src( paths.css )
.pipe( $.stylus( { use: [ $.nib() ] } ) )
.pipe( gulp.dest( 'elements' ) );
2014-08-15 22:04:51 +00:00
} );
gulp.task( 'vulcanize', function() {
2014-08-21 17:20:06 +00:00
gulp.src( paths.main )
.pipe( $.vulcanize( {
2014-08-15 22:04:51 +00:00
dest: 'build',
2014-08-21 17:20:06 +00:00
inline: true
// strip: true
2014-08-15 22:04:51 +00:00
} ) );
} );
2014-08-21 17:20:06 +00:00
gulp.task( 'readme', function() {
2014-08-22 02:36:49 +00:00
var content = {
readme: $.marked( fs.readFileSync( 'README.md', 'utf8' ) )
}
gulp.src( 'docs/template.html' )
.pipe( $.plates( content ) )
.pipe( $.rename( 'index.html' ) )
.pipe( gulp.dest( './' ) );
2014-08-21 17:20:06 +00:00
} );
gulp.task( 'test', function() {
} );
2014-08-21 17:20:06 +00:00
gulp.task( 'build', [ 'css', 'vulcanize', 'test' ] );
gulp.task( 'default', function() {
gulp.watch( [ paths.css ], [ 'css', 'vulcanize' ] );
gulp.watch( [ paths.js, paths.main, paths.html ], [ 'vulcanize', 'test' ] );
// gulp.watch( [ paths.tests, 'test' ] ); // not working?
2014-08-22 02:36:49 +00:00
gulp.watch( [ 'README.md', 'docs/template.html' ], [ 'readme' ] );
2014-08-21 17:20:06 +00:00
} );