gulpfile.js
changeset 491 c9d11caf62fc
parent 434 5635abeac42d
child 560 1ee4e482bfe7
equal deleted inserted replaced
490:135a744a7732 491:c9d11caf62fc
     1 var gulp = require('gulp'),
     1 var gulp = require('gulp'),
     2 	concat = require('gulp-concat');
     2 	concat = require('gulp-concat');
     3 
     3 
     4 var package = require("./package.json"),
     4 var package = require("./package.json"),
     5 	scripts = package.scripts,
     5 	scripts = package.scripts;
     6 	sources = scripts.sources;
       
     7 
     6 
     8 
     7 
     9 /** Fix pipe function */
     8 /** Fix pipe function */
    10 function fixPipe(stream) {
     9 function fixPipe(stream) {
    11 	var origPipe = stream.pipe;
    10 	var origPipe = stream.pipe;
    34 };
    33 };
    35 
    34 
    36 
    35 
    37 // Gulp tasks
    36 // Gulp tasks
    38 gulp.task('scripts', function() {
    37 gulp.task('scripts', function() {
    39 	return gulp.src(sources, {cwd: scripts.base})
    38 	return gulp.src(scripts.sources, {cwd: scripts.base})
    40 		.pipe(concat(scripts.target.replace(/{version}/, package.version)))
    39 		.pipe(concat(scripts.target.replace(/{version}/, package.version)))
    41 		.pipe(gulp.dest(scripts.base));
    40 		.pipe(gulp.dest(scripts.base));
    42 });
    41 });
    43 
    42 
    44 gulp.task('watch', function() {
    43 gulp.task('scripts-core', function() {
    45 	gulp.watch(sources, {cwd: scripts.base}, ['scripts']);
    44 	return gulp.src(scripts.core_sources, {cwd: scripts.base})
       
    45 		.pipe(concat(scripts.core_target.replace(/{version}/, package.version)))
       
    46 		.pipe(gulp.dest(scripts.base));
    46 });
    47 });
    47 
    48 
    48 gulp.task('default', ['scripts', 'watch']);
    49 gulp.task('watch', function() {
       
    50 	gulp.watch(scripts.sources, {cwd: scripts.base}, ['scripts', 'scripts-core']);
       
    51 });
       
    52 
       
    53 gulp.task('default', ['scripts', 'scripts-core', 'watch']);