-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
49 lines (44 loc) · 1.04 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
var
gulp = require( 'gulp' ),
browserSync = require( 'browser-sync' ),
pump = require( 'pump' ),
$ = require( 'gulp-load-plugins' )( {lazy: true} );
gulp.task( 'styles', function () {
pump( [
gulp.src( './badgeup/!(*vendor)/**/*.scss' ),
$.sass().on( 'error', $.sass.logError ),
$.autoprefixer( { browsers: ['last 2 version'] } ),
gulp.dest( './badgeup' )
] );
} );
gulp.task( 'scripts', function () {
pump( [
gulp.src( './badgeup/!(*vendor)/**/!(*.min).js' ),
$.sourcemaps.init(),
$.uglify(),
$.rename( {suffix: '.min'} ),
$.sourcemaps.write( '.' ),
gulp.dest( './badgeup' )
] );
} );
gulp.task( 'watch', function () {
// Watch .sass files
gulp.watch( './badgeup/!(*vendor)/**/*.scss', ['styles'] );
// Watch .js files
gulp.watch( './badgeup/!(*vendor)/**/!(*.min).js', ['scripts'] );
} );
// build everything
gulp.task( 'build', function () {
gulp.start(
'styles',
'scripts'
);
} );
// build everything and watch for changes
gulp.task( 'default', function () {
gulp.start(
'styles',
'scripts',
'watch'
);
} );