-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
executable file
·45 lines (39 loc) · 1.01 KB
/
gulpfile.js
File metadata and controls
executable file
·45 lines (39 loc) · 1.01 KB
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
var path = require('path'),
gulp = require('gulp'),
gulpIf = require('gulp-if'),
gulpConcat = require('gulp-concat'),
gulpUglify = require('gulp-uglify');
var paths = {
src: 'src',
dest: 'dest'
};
var user = {
name: 'user',
path: 'js',
mask: [
'*.module.js',
'**/*.module.js',
'**/*.config.js',
'**/*.*.js'
]
};
gulp.task('build:js', function () {
gulp.src((function (mask, src) {
return mask.map(function (pattern) {
return path.join(paths.src, src, pattern);
});
})(user.mask, user.path))
.pipe(gulpConcat([user.name, 'min', 'js'].join('.')))
.pipe(gulpUglify())
.pipe(gulp.dest(paths.dest))
});
gulp.task('build:html', function () {
gulp.src(path.join(paths.src, 'html/**/*.html'))
.pipe(gulp.dest(paths.dest + '/users'));
});
gulp.task('build', function () {
gulp.start('build:js', 'build:html');
});
gulp.task('default', function () {
gulp.start('build');
});