forked from athletics/PastPresentFuture
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
43 lines (35 loc) · 1.05 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
var gulp = require( 'gulp' ),
watch = require( 'gulp-watch' ),
requirejs = require( 'requirejs' ),
pkg = require( './package.json' )
;
var rjs = function ( name, out, optimize ) {
var ext = optimize ? '.min.js' : '.js',
banner = '/*!\n' +
' * ' + pkg.name + ' - ' + pkg.description + '\n' +
' *\n' +
' * @author ' + pkg.author.name + ' - ' + pkg.author.url + '\n' +
' * @see ' + pkg.homepage + '\n' +
' * @version ' + pkg.version + '\n' +
' */'
;
requirejs.optimize( {
name: name,
out: out + ext,
optimize: ( optimize ? 'uglify2' : 'none' ),
paths: {
jquery: 'empty:'
},
wrap: {
start: banner
}
} );
};
gulp.task( 'js', function () {
rjs( './js/Index', './dist/PastPresentFuture', false );
rjs( './js/Index', './dist/PastPresentFuture', true );
} );
gulp.task( 'watch', function () {
gulp.watch( 'js/*.js', [ 'js' ] );
} );
gulp.task( 'default', [ 'js', 'watch' ] );