-
Notifications
You must be signed in to change notification settings - Fork 61
/
gulpfile.js
37 lines (32 loc) · 1.06 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
var gulp = require('gulp')
, rename = require('gulp-rename')
, uglify = require('gulp-uglify')
, sass = require('gulp-sass')
;
gulp.task('scripts', function() {
gulp.src('./lib/angular/angular.min.js')
.pipe(gulp.dest('./demo/js'));
});
gulp.task('styles', function() {
gulp.src('./demo/styles/main.scss')
.on('data', function(file) {
// https://github.com/dlmanning/gulp-sass/issues/28#issuecomment-43951089
var path = require('path');
if (process.platform === 'win32') {
file.path = path.relative('.', file.path);
file.path = file.path.replace(/\\/g, '/');
}
})
.pipe(sass({ errLogToConsole: true })) // error handling still breaks in conjunction with sourcemaps
.pipe(gulp.dest('./demo/styles'));
});
gulp.task('compress', function() {
gulp.src('src/*.js')
.pipe(uglify())
.pipe(rename("ng-FitText.min.js"))
.pipe(gulp.dest('dist'))
});
gulp.task('watch', function() {
gulp.watch('./demo/**/*.scss', ['styles']);
});
gulp.task('default',['styles', 'scripts']);