-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
52 lines (40 loc) · 1.07 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
'use strict';
var FILE_SPLIT = '<!--quark-->';
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var concat = require('gulp-concat');
var change = require('gulp-change');
var del = require('del');
var vanilla = require('./gulp/vanilla.js');
var ALL_JS = 'src/js/';
var INDEX = 'src/index.html';
var QUARKS_JS = 'src/js/quarks/';
var DEST = 'dest/';
gulp.task('concat', function()
{
return gulp.src(QUARKS_JS + '*.js')
.pipe(concat('V.js', {newLine: FILE_SPLIT + '\n'}))
.pipe(change(vanilla.constructV))
.pipe(gulp.dest(ALL_JS));
});
gulp.task('concat:watch', function ()
{
gulp.watch(QUARKS_JS + '/*.js', ['concat']);
});
gulp.task('copy:index', function ()
{
return gulp.src(INDEX)
.pipe(gulp.dest(DEST));
});
gulp.task('clean:dest', function ()
{
return del([DEST + '**/*']);
});
gulp.task('build', ['clean:dest', 'copy:index', 'concat'], function()
{
return gulp.src(ALL_JS + 'V.js')
.pipe(uglify())
.pipe(change(vanilla.wrapAnonymous))
.pipe(gulp.dest(DEST + 'js/'));
});
gulp.task('default',['concat', 'concat:watch']);