-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
50 lines (40 loc) · 1.32 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
'use strict';
var gulp = require('gulp');
var concat = require('gulp-concat');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
var cleanCSS = require('gulp-clean-css');
var DEST = './dist/';
var jsfiles = [
'node_modules/dc/dc.js',
'node_modules/d3/d3.js',
'node_modules/crossfilter/crossfilter.js',
'node_modules/boostrap/dist/js/boostrap.js',
'node_modules/jquery/dist/jquery.js',
];
var cssfiles = ['node_modules/bootstrap/dist/css/bootstrap.css','node_modules/bootstrap/dist/css/bootstrap-theme.css','node_modules/dc/dc.css'];
//node_modules/bootstrap/dist/css/bootstrap
//node_modules/jquery/dist/jquery.js
gulp.task('copy', function() {
gulp.src(jsfiles)
.pipe(gulp.dest(DEST + 'js'));
gulp.src(cssfiles)
.pipe(gulp.dest(DEST + 'css'));
});
gulp.task('minify-css', function() {
return gulp.src(DEST+ 'css/*.css')
.pipe(concat('style.css'))
.pipe(cleanCSS({compatibility: 'ie9'}))
.pipe(gulp.dest(DEST));
});
gulp.task('minify-js', ['copy'],function() {
return gulp.src(DEST+'js/*.js')
// This will output the non-minified version
.pipe(concat('all.js'))
.pipe(gulp.dest(DEST))
// This will minify and rename to foo.min.js
.pipe(uglify())
.pipe(rename({ extname: '.min.js' }))
.pipe(gulp.dest(DEST));
});
gulp.task('default', ['minify-css','minify-js']);