-
Notifications
You must be signed in to change notification settings - Fork 16
/
gulpfile.js
61 lines (51 loc) · 1.66 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
/* global require */
var gulp = require('gulp');
var clean = require('gulp-clean');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var minifyCSS = require('gulp-minify-css');
var merge = require('merge-stream');
var globs = {
dist: "./dist",
js: [
"./res/js/jquery-1.7.min.js",
"./res/js/TheShodo.js",
"./res/js/TheShodo.FloatingPanel.js",
"./res/js/TheShodo.Shodo.Core.js",
"./res/js/TheShodo.Shodo.Player.js",
"./res/js/TheShodo.Shodo.Resources.js",
"./res/js/TheShodo.Shodo.Write.js",
"./res/js/kazari.js",
"./res/js/floatingPanels.js"
],
css: [
"./res/css/base.css",
"./res/css/index.css",
],
images: "./res/img/*",
media: "./res/media/*"
};
gulp.task('clean', function () {
return gulp.src([globs.dist], { read: false })
.pipe(clean());
});
gulp.task('assets', ['clean'], function () {
var images = gulp.src(globs.images).pipe(gulp.dest(globs.dist + '/res/img'));
var media = gulp.src(globs.media).pipe(gulp.dest(globs.dist + '/res/media'));
var html = gulp.src('./index.html').pipe(gulp.dest(globs.dist));
return merge(images, media, html);
});
gulp.task('styles', ['clean'], function () {
return gulp.src(globs.css)
.pipe(concat('bundle.css'))
.pipe(minifyCSS())
.pipe(gulp.dest(globs.dist + '/res/css'));
});
gulp.task('scripts', ['clean'], function () {
return gulp.src(globs.js)
.pipe(concat('bundle.js'))
.pipe(uglify())
.pipe(gulp.dest(globs.dist + '/res/js'));
});
gulp.task('build', ['scripts', 'styles', 'assets']);
gulp.task('default', ['build']);