-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathgulpfile.js
105 lines (85 loc) · 2.64 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
// Generated by CoffeeScript 1.7.0
(function() {
var GulpEste, dirs, este, gulp, paths, runSequence;
gulp = require('gulp');
GulpEste = require('gulp-este');
runSequence = require('run-sequence');
este = new GulpEste(__dirname, true, '../../../..');
paths = {
stylus: ['src/css/datepicker.styl'],
coffee: ['bower_components/este-library/este/**/*.coffee', 'src/**/*.coffee'],
jsx: ['src/**/*.jsx'],
js: ['bower_components/closure-library/**/*.js', 'bower_components/este-library/este/**/*.js', 'src/**/*.js', 'tmp/**/*.js', '!**/build/**'],
compiler: 'bower_components/closure-compiler/compiler.jar',
externs: ['bower_components/react-externs/externs.js'],
thirdParty: {
development: [],
production: []
}
};
dirs = {
googBaseJs: 'bower_components/closure-library/closure/goog',
watch: ['src']
};
gulp.task('stylus', function() {
return este.stylus(paths.stylus);
});
gulp.task('coffee', function() {
return este.coffee(paths.coffee);
});
gulp.task('jsx', function() {
return este.jsx(paths.jsx);
});
gulp.task('transpile', function(done) {
return runSequence('stylus', 'coffee', 'jsx', done);
});
gulp.task('deps', function() {
return este.deps(paths.js);
});
gulp.task('concat-deps', function() {
return este.concatDeps();
});
gulp.task('compile-datepicker', function() {
return este.compile(paths.js, 'src/build', {
fileName: 'datepicker.min.js',
compilerPath: paths.compiler,
compilerFlags: {
closure_entry_point: 'misino.ui.datepicker.DatePickerInput',
externs: paths.externs,
warning_level: 'VERBOSE',
compilation_level: 'ADVANCED_OPTIMIZATIONS'
}
});
});
gulp.task('concat-all', function() {
return este.concatAll({
'src/build/react-datepicker-thirdparty.js': paths.thirdParty
});
});
gulp.task('js', function(done) {
return runSequence.apply(null, [este.shouldCreateDeps() ? 'deps' : void 0, 'concat-deps', 'compile-datepicker', 'concat-all', done].filter(function(task) {
return task;
}));
});
gulp.task('build', function(done) {
return runSequence('transpile', 'js', done);
});
gulp.task('watch', function() {
return este.watch(dirs.watch, {
coffee: 'coffee',
js: 'js',
jsx: 'jsx',
styl: 'stylus'
}, function(task) {
return gulp.start(task);
});
});
gulp.task('run', function(done) {
return runSequence.apply(null, ['watch', done].filter(function(task) {
return task;
}));
});
gulp.task('default', function(done) {
return runSequence('build', 'run', done);
});
}).call(this);