-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
53 lines (43 loc) · 1.31 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
// Gulp Dependencies
var gulp = require('gulp');
var rename = require('gulp-rename');
// Build Dependencies
var browserify = require('gulp-browserify');
var uglify = require('gulp-uglify');
// Style Dependencies
var less = require('gulp-less');
var prefix = require('gulp-autoprefixer');
var minifyCSS = require('gulp-minify-css');
// Development Dependencies
var jshint = require('gulp-jshint');
// Test Dependencies
var mochaPhantomjs = require('gulp-mocha-phantomjs');
gulp.task('browserify-client', function() {
return gulp.src('js/main.js')
.pipe(browserify({
insertGlobals: true
}))
.pipe(rename('smart-forms.js'))
.pipe(gulp.dest('build'));
});
gulp.task('watch', function() {
gulp.watch('js/**/*.js', ['browserify-client']);
});
gulp.task('styles', function() {
return gulp.src('styles/less/index.less')
.pipe(less())
.pipe(prefix({ cascade: true }))
.pipe(rename('smart-forms.css'))
.pipe(gulp.dest('build'));
});
gulp.task('minify', ['styles'], function() {
return gulp.src('build/smart-forms.css')
.pipe(minifyCSS())
.pipe(rename('smart-forms.min.css'));
});
gulp.task('uglify', ['browserify-client'], function() {
return gulp.src('build/smart-forms.js')
.pipe(uglify())
.pipe(rename('smart-forms.min.js'));
});
gulp.task('build', ['uglify', 'minify']);