-
Notifications
You must be signed in to change notification settings - Fork 3
/
gulpfile.js
40 lines (33 loc) · 975 Bytes
/
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
var gulp = require('gulp'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
rename = require('gulp-rename'),
inject = require('gulp-inject');
var paths = {
scripts: ['src/**/*.js', 'spec/*.js', 'spec/fixtures/*.js', 'spec/fixtures/Project.js']
};
gulp.task('default', function() {
return gulp.start('build.min');
});
gulp.task('build', function() {
return gulp.src('src/*.js')
.pipe(concat('rrm.js'))
.pipe(gulp.dest('build'))
;
});
gulp.task('build.min', ['build'], function() {
return gulp.src('build/rrm.js')
.pipe(uglify())
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('build'))
;
});
gulp.task('dev', function() {
var files = gulp.src(paths.scripts);
return gulp.src('spec/SpecRunner.html')
.pipe(inject(files, { addRootSlash: false }))
.pipe(gulp.dest('.'))
});
gulp.task('watch', function() {
gulp.watch(paths.scripts, ['dev']);
});