-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
51 lines (44 loc) · 1.44 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
var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
var del = require('del');
var browserSync = require('browser-sync').create();
gulp.task('package', ['clean', 'compile']);
gulp.task('compile', ['compile:js', 'compile:css']);
gulp.task('serve', ['compile', 'browser-sync']);
gulp.task('clean', function() {
return del(['coverage', 'dist']);
});
gulp.task('compile:js', function() {
gulp.src('./src/*.js')
// .pipe($.sourcemaps.init())
.pipe($.rollup({
entry: './src/ng-dialogs.js',
format: 'umd'
}))
.pipe($.ngAnnotate())
// .pipe($.sourcemaps.write('./'))
.pipe(gulp.dest('./dist'));
});
gulp.task('compile:css', function() {
gulp.src('./src/*.scss')
// .pipe($.sourcemaps.init())
.pipe($.sass({outputStyle: 'expanded'}))
// .pipe($.sourcemaps.write('./'))
.pipe(gulp.dest('./dist'))
.pipe(browserSync.stream());
});
gulp.task('browser-sync', function() {
browserSync.init({
server: {
baseDir: './demo',
routes: {
'/node_modules': 'node_modules',
'/dist': 'dist'
}
}
});
gulp.watch('src/*.js', ['compile:js']);
gulp.watch('src/*.scss', ['compile:css']);
gulp.watch('dist/*.js').on('change', browserSync.reload);
gulp.watch('demo/*.*').on('change', browserSync.reload);
});