This repository has been archived by the owner on Jan 10, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
67 lines (58 loc) · 2.42 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
var gulp = require('gulp');
var coffee = require("gulp-coffee");
var del = require('del');
var uglify = require('gulp-uglify');
var concat = require('gulp-concat');
var sass = require('gulp-sass');
var uncss = require('gulp-uncss');
var nano = require('gulp-cssnano');
var jshint = require('gulp-jshint');
var jstylish = require('jshint-stylish');
var coffeelint = require('gulp-coffeelint');
var cstylish = require('coffeelint-stylish');
gulp.task('lint', function () {
gulp.src(['./src/lib/control.js', './src/lib/globe.js', './src/lib/galleryctl.js', './src/lib/util.js', './src/lib/jquery.modal.js', './src/chromatic/lib/*.js'])
.pipe(jshint())
.pipe(jshint.reporter(jstylish));
gulp.src(['./src/chromatic/views/**.coffee', './src/chromatic/plugin.coffee'])
.pipe(coffeelint())
.pipe(coffeelint.reporter(cstylish));
});
gulp.task('lintcjs', function () {
gulp.src('./src/lib/chromatic.js')
.pipe(jshint())
.pipe(jshint.reporter(jstylish));
});
gulp.task('coffee', function() {
return gulp.src(['./src/chromatic/views/**.coffee', './src/chromatic/plugin.coffee'])
.pipe(coffee())
.pipe(concat('plugin.js'))
.pipe(gulp.dest('./src/chromatic/build'))
})
gulp.task('chromatic', ['coffee'], function() {
return gulp.src(['./src/chromatic/lib/*.js', './src/chromatic/build/plugin.js'])
.pipe(concat('chromatic.js'))
.pipe(gulp.dest('./src/lib/'))
})
gulp.task('javascript', ['chromatic'], function() {
return gulp.src(['./src/lib/*.js'])
.pipe(uglify())
.pipe(concat('odyssey.js'))
.pipe(gulp.dest('./dist/assets/js/'))
})
gulp.task('css', function () {
return gulp.src(['./src/sass/*.scss'])
.pipe(sass().on('error', sass.logError))
.pipe(uncss({
html: ['./dist/index.html'],
ignore: [/chromatic-.*/, /iglobe-.*/, '#map', '.modal', /modal-.*/, '.modal a.close-modal', '.blocker', '.blocker:before',
'#titleBar', '#gallery div', '.fa-chevron-up', '#titleBar .toggle', '#titleBar .toggle:before', '#titleBar .title',
'#titleBar .title a', 'body.header-visible #wrapper', 'body.header-visible #titleBar', 'body.header-visible #header']
}))
.pipe(nano())
.pipe(gulp.dest('./dist/assets/css'));
});
gulp.task('build-and-clean', ['javascript', 'css'], function() {
del(['./src/chromatic/build']);
})
gulp.task('default', ['build-and-clean'])