-
Notifications
You must be signed in to change notification settings - Fork 59
/
gulpfile.js
69 lines (64 loc) · 2.97 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
/*
* Copyright (c) 2012-2016, b3log.org & hacpai.com & fangstar.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file frontend tool.
*
* @author <a href="mailto:[email protected]">Liyuan Li</a>
* @version 0.1.0.0, Jan 29, 2016
*/
var gulp = require("gulp");
var concat = require('gulp-concat');
var cleanCSS = require('gulp-clean-css');
var uglify = require('gulp-uglify');
var sourcemaps = require("gulp-sourcemaps");
gulp.task('cc', function () {
// css
// var cssLibs = ['./static/js/lib/jquery-layout/layout-default-latest.css',
// './static/js/lib/codemirror-5.1/codemirror.css',
// './static/js/lib/codemirror-5.1/addon/hint/show-hint.css',
// './static/js/lib/codemirror-5.1/addon/lint/lint.css',
// './static/js/lib/codemirror-5.1/addon/fold/foldgutter.css',
// './static/js/lib/codemirror-5.1/addon/dialog/dialog.css',
// './static/js/overwrite/codemirror/theme/*.css'];
// gulp.src(cssLibs)
// .pipe(cleanCSS())
// .pipe(concat('lib.min.css'))
// .pipe(gulp.dest('./static/css/'));
gulp.src('./src/main/webapp/js/lib/editor/codemirror.css')
.pipe(cleanCSS())
.pipe(concat('codemirror.min.css'))
.pipe(gulp.dest('./src/main/webapp/js/lib/editor/'));
// js
var jsJqueryUpload = ['./src/main/webapp/js/lib/jquery/file-upload-9.10.1/vendor/jquery.ui.widget.js',
'./src/main/webapp/js/lib/jquery/file-upload-9.10.1/jquery.iframe-transport.js',
'./src/main/webapp/js/lib/jquery/file-upload-9.10.1/jquery.fileupload.js',
'./src/main/webapp/js/lib/jquery/file-upload-9.10.1/jquery.fileupload-process.js',
'./src/main/webapp/js/lib/jquery/file-upload-9.10.1/jquery.fileupload-validate.js'];
gulp.src(jsJqueryUpload)
.pipe(uglify())
.pipe(concat('jquery.fileupload.min.js'))
.pipe(gulp.dest('./src/main/webapp/js/lib/jquery/file-upload-9.10.1/'));
var jsCodemirror = ['./src/main/webapp/js/lib/editor/diff_match_patch.js',
'./src/main/webapp/js/lib/editor/codemirror.js',
'./src/main/webapp/js/lib/editor/fullscreen.js',
'./src/main/webapp/js/lib/editor/placeholder.js',
'./src/main/webapp/js/lib/editor/merge.js',
'./src/main/webapp/js/overwrite/codemirror/addon/hint/show-hint.js'];
gulp.src(jsCodemirror)
.pipe(uglify())
.pipe(concat('codemirror.min.js'))
.pipe(gulp.dest('./src/main/webapp/js/lib/editor/'));
});