forked from miniasp/f2e-workflow-labs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
71 lines (55 loc) · 1.76 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
68
69
70
var gulp = require('gulp');
var del = require('del');
var plugins = require('gulp-load-plugins')();
// var concat = require('gulp-concat');
// var uglify = require('gulp-uglify');
// var rename = require('gulp-rename');
var config = require('./config');
gulp.task('default', ['mytask1'], function() {
console.log('My Default Task');
});
gulp.task('mytask1', ['mytask2'], function() {
console.log('Task1 Output');
});
gulp.task('mytask2', function() {
console.log('Task2 Output');
});
gulp.task('output1', function() {
gulp.src('assets/vendor/bootstrap/**/*.js')
.pipe(gulp.dest('output1'));
});
gulp.task('output3', function() {
gulp.src(['assets/vendor/**/*.js',
'assets/vendor/**/*.css'], { base: 'assets/vendor/' })
//.pipe(gulp.dest('output3'));
});
gulp.task('output2', ['clean'], function() {
gulp.src('assets/vendor/bootstrap/**/*.js', { base: 'assets/vendor/' })
.pipe(gulp.dest('output2'));
});
gulp.task('clean', function(cb) {
del(['output2/**', '!output2'])
.then(function (paths) {
console.log('Deleted files/folders:\n', paths.join('\n'));
})
.then(cb);
});
gulp.task('watch', function() {
gulp.watch(config.appPath + '/**', ['concat-app']);
});
gulp.task('concat-app', function() {
gulp.src(config.appPath + '/**/*.module.js')
.pipe(gulp.dest('src/app'))
.pipe(plugins.concat('app.modules.js'))
.pipe(gulp.dest('assets'))
.pipe(plugins.uglify())
.pipe(plugins.rename({extname: '.min.js'}))
.pipe(gulp.dest('assets'));
gulp.src([config.appPath + '/**/*.js', '!' + config.appPath + '/**/*.module.js'])
.pipe(gulp.dest('src/app'))
.pipe(plugins.concat('app.bundles.js'))
.pipe(gulp.dest('assets'))
.pipe(plugins.uglify( { mangle: false } ))
.pipe(plugins.rename({extname: '.min.js'}))
.pipe(gulp.dest('assets'));
});