-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
67 lines (54 loc) · 1.34 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
var gulp = require('gulp'),
del = require('del'),
rename = require('gulp-rename'),
jeditor = require("gulp-json-editor");
var root = 'app/';
var output = 'build';
gulp.task('clean', function(cb) {
del.sync([output], cb);
});
gulp.task('index', function () {
gulp.src('index.html')
.pipe(gulp.dest(output)
);
});
gulp.task('styles', function () {
gulp.src('styles.css')
.pipe(gulp.dest(output)
);
});
gulp.task('systemjsconfig', function () {
gulp.src('systemjs.config.js.prod')
.pipe(rename('systemjs.config.js'))
.pipe(gulp.dest(output)
);
});
gulp.task('package', function () {
gulp.src('./package.json')
.pipe(jeditor(function(json){
return {
"name": json.name,
"version": json.version,
"description": json.description,
"scripts": {
"start": json.scripts.start
},
"author": json.author,
"license": json.license,
"dependencies": json.dependencies
};
}))
.pipe(gulp.dest(output + '/')
);
});
gulp.task('app', function () {
gulp.src('app/' + '*.{js,html}')
.pipe(gulp.dest(output + '/app')
);
});
gulp.task('appfolders', function () {
gulp.src('app/' + '**/*.{js,html}')
.pipe(gulp.dest(output + '/app')
);
});
gulp.task('default', ['clean', 'app', 'appfolders', 'package', 'systemjsconfig', 'index', 'styles']);