-
Notifications
You must be signed in to change notification settings - Fork 19
/
gulpfile.js
40 lines (32 loc) · 1.1 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
(function() {
'use strict';
var gulp = require('gulp'),
uglify = require('gulp-uglify'),
browserify = require('browserify'),
source = require('vinyl-source-stream'),
buffer = require('vinyl-buffer'),
concat = require('gulp-concat'),
rename = require('gulp-rename'),
minifyCSS = require('gulp-minify-css'),
stripCssComments = require('gulp-strip-css-comments');
// CSS
gulp.task('css', function() {
return gulp.src(['./node_modules/bootstrap/dist/css/bootstrap.min.css', 'public/css/main.css'])
.pipe(minifyCSS())
.pipe(stripCssComments())
.pipe(concat('style.css'))
.pipe(rename('style.min.css'))
.pipe(gulp.dest('public/css'));
});
// JavaScript
gulp.task('js', function() {
return browserify('./public/js/main.js')
.bundle()
.pipe(source('appp.js'))
.pipe(buffer())
.pipe(uglify())
.pipe(rename('app.min.js'))
.pipe(gulp.dest('./public/js/'));
});
gulp.task('default', ['css', 'js']);
})();