client/gulpfile.js
author rougeronj
Wed, 08 Apr 2015 00:37:52 +0200
changeset 78 aaffa46a2b79
parent 49 88cd0bb61c12
child 83 6a169ef52314
permissions -rw-r--r--
add gulp task "copy-server" to copy the project built, on the django server
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
var gulp = require('gulp');
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
var gutil = require('gulp-util')
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
var plugins = require("gulp-load-plugins")({lazy:false});
78
aaffa46a2b79 add gulp task "copy-server" to copy the project built, on the django server
rougeronj
parents: 49
diff changeset
     4
var htmlreplace = require('gulp-html-replace');
0
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
//var flatten = require('gulp-flatten');
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
//var uglify = require('gulp-uglify');
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
//var clean = require('gulp-clean');
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
//var rename = require('gulp-rename');
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
//var filesize = require('gulp-filesize');
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
//var cssmin  = require('gulp-cssmin');
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
gulp.task('clean', function () {
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
  return gulp.src('build', {read: false})
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
    .pipe(clean());
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
});
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
var scriptsSrc = ['!./app/**/*_test.js','./app/**/*.js'];
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    18
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    19
gulp.task('scripts', function(){
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    20
    //combine all js files of the app
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    21
    gulp.src(scriptsSrc)
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    22
        .pipe(plugins.jshint())
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    23
        .pipe(plugins.jshint.reporter('default'))
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    24
        .pipe(plugins.jshint.reporter('fail'))
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    25
        .pipe(plugins.concat('app.js'))
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    26
        .pipe(gulp.dest('./build'))
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    27
        .pipe(plugins.filesize())
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    28
        .pipe(plugins.uglify())
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    29
        .pipe(plugins.rename('app.min.js'))
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    30
        .pipe(gulp.dest('./build'))
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    31
        .pipe(plugins.filesize())
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    32
        .on('error', gutil.log);
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    33
});
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    34
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    35
gulp.task('templates',function(){
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    36
    //combine all template files of the app into a js file
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    37
    gulp.src(['!./app/index.html',
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    38
        './app/**/*.html'])
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    39
        .pipe(plugins.angularTemplatecache('templates.js',{standalone:true}))
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    40
        .pipe(gulp.dest('./build'));
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    41
});
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    42
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    43
gulp.task('css', function(){
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    44
    gulp.src('./app/**/*.css')
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    45
//        .pipe(plugins.csslint())
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    46
//        .pipe(plugins.csslint.reporter())
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    47
        .pipe(plugins.concat('app.css'))
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    48
        .pipe(gulp.dest('./build'))
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    49
        .pipe(plugins.filesize())
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    50
        .pipe(plugins.minifyCss({keepBreaks:true}))
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    51
        .pipe(plugins.rename('app.min.css'))
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    52
        .pipe(gulp.dest('./build'))
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    53
        .pipe(plugins.filesize());
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    54
});
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    55
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    56
var vendorJSsrc = [
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    57
  '!./bower_components/**/*.min.js',
44
5eab9718182b FIX and update the client dev environment - update bootstrap - ignore index.js files and every file from bootstrap beside the css
rougeronj
parents: 0
diff changeset
    58
  '!./bower_components/bootstrap/**/*',
0
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    59
  '!./bower_components/jquery/src/**/*',
49
88cd0bb61c12 add ui-sortble lib to be able to sort the list of the slide in the book view - it sends a post request to the server to update the slides' order
rougeronj
parents: 44
diff changeset
    60
  '!./bower_components/jquery-ui/themes/**',
88cd0bb61c12 add ui-sortble lib to be able to sort the list of the slide in the book view - it sends a post request to the server to update the slides' order
rougeronj
parents: 44
diff changeset
    61
  '!./bower_components/jquery-ui/ui/**',
88cd0bb61c12 add ui-sortble lib to be able to sort the list of the slide in the book view - it sends a post request to the server to update the slides' order
rougeronj
parents: 44
diff changeset
    62
  '!./bower_components/jquery-ui/ui/*.js',
44
5eab9718182b FIX and update the client dev environment - update bootstrap - ignore index.js files and every file from bootstrap beside the css
rougeronj
parents: 0
diff changeset
    63
  '!./bower_components/**/index.js',
5eab9718182b FIX and update the client dev environment - update bootstrap - ignore index.js files and every file from bootstrap beside the css
rougeronj
parents: 0
diff changeset
    64
  './bower_components/bootstrap/dist/css/*',
0
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    65
  './bower_components/jquery/dist/jquery.js',
44
5eab9718182b FIX and update the client dev environment - update bootstrap - ignore index.js files and every file from bootstrap beside the css
rougeronj
parents: 0
diff changeset
    66
  './bower_components/angular/angular.js',
5eab9718182b FIX and update the client dev environment - update bootstrap - ignore index.js files and every file from bootstrap beside the css
rougeronj
parents: 0
diff changeset
    67
  './bower_components/angular-route/angular-route.js',
5eab9718182b FIX and update the client dev environment - update bootstrap - ignore index.js files and every file from bootstrap beside the css
rougeronj
parents: 0
diff changeset
    68
  './bower_components/angular-resource/angular-resource.js',
5eab9718182b FIX and update the client dev environment - update bootstrap - ignore index.js files and every file from bootstrap beside the css
rougeronj
parents: 0
diff changeset
    69
  './bower_components/angular-bootstrap/ui-bootstrap.js',
0
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    70
  './bower_components/**/*.js'
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    71
];
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    72
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    73
gulp.task('vendorJS', function(){
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    74
    //concatenate vendor JS files
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    75
    gulp.src(vendorJSsrc)
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    76
        .pipe(plugins.concat('lib.js'))
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    77
        .pipe(gulp.dest('./build'))
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    78
        .pipe(plugins.filesize())
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    79
        .pipe(plugins.uglify())
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    80
        .pipe(plugins.rename('lib.min.js'))
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    81
        .pipe(gulp.dest('./build'))
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    82
        .pipe(plugins.filesize())
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    83
        .on('error', gutil.log);
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    84
});
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    85
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    86
gulp.task('vendorCSS', function(){
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    87
    //concatenate vendor CSS files
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    88
    gulp.src(['!./bower_components/**/*.min.css',
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    89
        './bower_components/**/*.css'])
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    90
        .pipe(plugins.concat('lib.css'))
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    91
        .pipe(gulp.dest('./build'))
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    92
        .pipe(plugins.filesize())
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    93
        .pipe(plugins.minifyCss({keepBreaks:true}))
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    94
        .pipe(plugins.rename('lib.min.css'))
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    95
        .pipe(gulp.dest('./build'))
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    96
        .pipe(plugins.filesize());
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    97
});
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    98
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
    99
gulp.task('vendorFonts', function(){
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   100
    gulp.src(['./bower_components/**/fonts/*'])
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   101
        .pipe(plugins.flatten())
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   102
        .pipe(gulp.dest('./build/fonts'));
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   103
});
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   104
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   105
gulp.task('copy-index', function() {
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   106
    gulp.src('./app/index.html')
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   107
        .pipe(gulp.dest('./build'));
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   108
});
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   109
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   110
gulp.task('copy-data', function() {
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   111
    gulp.src('./data/**/*')
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   112
        .pipe(gulp.dest('./build/data'));
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   113
});
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   114
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   115
gulp.task('copy-img', function() {
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   116
    gulp.src('./img/**/*')
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   117
        .pipe(gulp.dest('./build/img'));
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   118
});
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   119
78
aaffa46a2b79 add gulp task "copy-server" to copy the project built, on the django server
rougeronj
parents: 49
diff changeset
   120
gulp.task('copy-server', function() {
aaffa46a2b79 add gulp task "copy-server" to copy the project built, on the django server
rougeronj
parents: 49
diff changeset
   121
    gulp.src('./build/img/**/*')
aaffa46a2b79 add gulp task "copy-server" to copy the project built, on the django server
rougeronj
parents: 49
diff changeset
   122
        .pipe(gulp.dest('./../server/ammico/static/ammico/img'));
aaffa46a2b79 add gulp task "copy-server" to copy the project built, on the django server
rougeronj
parents: 49
diff changeset
   123
    gulp.src('./build/fonts/**/*')
aaffa46a2b79 add gulp task "copy-server" to copy the project built, on the django server
rougeronj
parents: 49
diff changeset
   124
		.pipe(gulp.dest('./../server/ammico/static/ammico/fonts'));
aaffa46a2b79 add gulp task "copy-server" to copy the project built, on the django server
rougeronj
parents: 49
diff changeset
   125
    gulp.src('./build/*.js')
aaffa46a2b79 add gulp task "copy-server" to copy the project built, on the django server
rougeronj
parents: 49
diff changeset
   126
    	.pipe(gulp.dest('./../server/ammico/static/ammico/js'));
aaffa46a2b79 add gulp task "copy-server" to copy the project built, on the django server
rougeronj
parents: 49
diff changeset
   127
    gulp.src('./build/*.css')
aaffa46a2b79 add gulp task "copy-server" to copy the project built, on the django server
rougeronj
parents: 49
diff changeset
   128
    	.pipe(gulp.dest('./../server/ammico/static/ammico/css'));
aaffa46a2b79 add gulp task "copy-server" to copy the project built, on the django server
rougeronj
parents: 49
diff changeset
   129
    gulp.src('./app/index.html')
aaffa46a2b79 add gulp task "copy-server" to copy the project built, on the django server
rougeronj
parents: 49
diff changeset
   130
    .pipe(htmlreplace({
aaffa46a2b79 add gulp task "copy-server" to copy the project built, on the django server
rougeronj
parents: 49
diff changeset
   131
    	django: '{% load static %}',
aaffa46a2b79 add gulp task "copy-server" to copy the project built, on the django server
rougeronj
parents: 49
diff changeset
   132
    	js:{
aaffa46a2b79 add gulp task "copy-server" to copy the project built, on the django server
rougeronj
parents: 49
diff changeset
   133
    		src: ['lib.js', 'templates.js', 'app.js'],
aaffa46a2b79 add gulp task "copy-server" to copy the project built, on the django server
rougeronj
parents: 49
diff changeset
   134
    		tpl: '<script src="{% static \'ammico/js/%s\' %}"></script>'
aaffa46a2b79 add gulp task "copy-server" to copy the project built, on the django server
rougeronj
parents: 49
diff changeset
   135
    	},
aaffa46a2b79 add gulp task "copy-server" to copy the project built, on the django server
rougeronj
parents: 49
diff changeset
   136
    	css: {
aaffa46a2b79 add gulp task "copy-server" to copy the project built, on the django server
rougeronj
parents: 49
diff changeset
   137
    		src: ['lib.css', 'app.css'],
aaffa46a2b79 add gulp task "copy-server" to copy the project built, on the django server
rougeronj
parents: 49
diff changeset
   138
    		tpl: '<link rel="stylesheet" type="text/css" href="{% static \'ammico/css/%s\' %}"/>'
aaffa46a2b79 add gulp task "copy-server" to copy the project built, on the django server
rougeronj
parents: 49
diff changeset
   139
    	},
aaffa46a2b79 add gulp task "copy-server" to copy the project built, on the django server
rougeronj
parents: 49
diff changeset
   140
    	imgLogo: {
aaffa46a2b79 add gulp task "copy-server" to copy the project built, on the django server
rougeronj
parents: 49
diff changeset
   141
    		src: 'ammico_logo_small.png',
aaffa46a2b79 add gulp task "copy-server" to copy the project built, on the django server
rougeronj
parents: 49
diff changeset
   142
    		tpl: '<img src="{% static \'ammico/img/%s\' %}">'
aaffa46a2b79 add gulp task "copy-server" to copy the project built, on the django server
rougeronj
parents: 49
diff changeset
   143
    	},
aaffa46a2b79 add gulp task "copy-server" to copy the project built, on the django server
rougeronj
parents: 49
diff changeset
   144
    	imgFooter: {
aaffa46a2b79 add gulp task "copy-server" to copy the project built, on the django server
rougeronj
parents: 49
diff changeset
   145
    		src: 'logo_IRI_footer.png',
aaffa46a2b79 add gulp task "copy-server" to copy the project built, on the django server
rougeronj
parents: 49
diff changeset
   146
    		tpl: '<img src="{% static \'ammico/img/%s\' %}" alt="Logo IRI" />'
aaffa46a2b79 add gulp task "copy-server" to copy the project built, on the django server
rougeronj
parents: 49
diff changeset
   147
    	}
aaffa46a2b79 add gulp task "copy-server" to copy the project built, on the django server
rougeronj
parents: 49
diff changeset
   148
    }))
aaffa46a2b79 add gulp task "copy-server" to copy the project built, on the django server
rougeronj
parents: 49
diff changeset
   149
    .pipe(gulp.dest('./../server/ammico/templates'));
aaffa46a2b79 add gulp task "copy-server" to copy the project built, on the django server
rougeronj
parents: 49
diff changeset
   150
});
aaffa46a2b79 add gulp task "copy-server" to copy the project built, on the django server
rougeronj
parents: 49
diff changeset
   151
0
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   152
gulp.task('watch',function(){
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   153
    gulp.watch([
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   154
        'build/**/*.html',
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   155
        'build/**/*.js',
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   156
        'build/**/*.css'
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   157
    ], function(event) {
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   158
        return gulp.src(event.path)
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   159
            .pipe(plugins.connect.reload());
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   160
    });
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   161
    gulp.watch(['./app/**/*.js','!./app/**/*test.js'],['scripts']);
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   162
    gulp.watch(['!./app/index.html','./app/**/*.html'],['templates']);
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   163
    gulp.watch('./app/**/*.css',['css']);
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   164
    gulp.watch('./app/index.html',['copy-index']);
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   165
    gulp.watch('./data/**/*',['copy-data']);
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   166
    gulp.watch('./img/**/*',['copy-img']);
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   167
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   168
});
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   169
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   170
gulp.task('connect', plugins.connect.server({
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   171
    root: ['build'],
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   172
    port: 9000,
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   173
    livereload: true
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   174
}));
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   175
cef349423167 add basic file org + client prototype
ymh <ymh.work@gmail.com>
parents:
diff changeset
   176
gulp.task('default',['connect','scripts','templates','css','copy-index','copy-data','copy-img','vendorJS','vendorCSS','vendorFonts','watch']);