-
Notifications
You must be signed in to change notification settings - Fork 16
/
gulpfile.js
72 lines (67 loc) · 1.63 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
var gulp = require('gulp');
var path = require('path');
var _ = require('lodash');
var me = __dirname;
var pkg = require('./package.json');
var exec = require('child_process').exec;
var options = {
// client side project
self: './',
project: 'public/',
// server side project
build: 'build/',
src: 'src/',
test: 'test/',
// for a client side project that needs minification
dist: 'dist/'
};
_(options).forOwn(function (v, k) {
options[k] = path.resolve(me, v);
});
// files that are not including in the app build
options.vendor = [
'q', 'lodash', 'dagre'
];
// tasks:
// - watch:browserify
// - browserify
require('./gulp/browserify')(options);
// tasks:
// - compass
// - watch:compass
require('./gulp/compass')(options);
// tasks:
// - server
require('./gulp/server')(options);
// tasks:
// - test
// - watch:test
require('./gulp/test')(options);
// tasks:
// - jshint
require('./gulp/linter')(options);
// tasks:
// - polymer
require('./gulp/polymer')(options);
// tasks:
// - release:major
// - release:minor
// - release:patch
require('./gulp/release')();
// main tasks
// NOTE: gulp.watch has conflicts with watchify
gulp.task('watch', ['watch:test', 'watch:compass', 'watch:browserify']);
gulp.task('default', ['watch'], function () {
// open http://localhost:3000/public/
gulp.start('server');
});
gulp.task('build:page', ['compass'], function (cb) {
gulp.start('polymer');
exec('cp -r public/css/ build/', function (err) {
cb(err);
});
});
gulp.task('build:app', ['browserify']);
// show be run with NODE_ENV=production
// to avoid calling watchify on the browserify task
gulp.task('build', ['build:app', 'build:page']);