-
Notifications
You must be signed in to change notification settings - Fork 29
/
gulpfile-lock.js
36 lines (32 loc) · 1.13 KB
/
gulpfile-lock.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
const gulp = require('gulp')
const cssBase64 = require('gulp-css-base64')
const uglify = require('gulp-uglify')
const stylus = require('gulp-stylus')
const rename = require('gulp-rename')
const header = require('gulp-header')
const config = require('./package.json')
// uglify
gulp.task('uglify', function () {
return gulp.src('./src/js/calendar-price-jquery.js')
.pipe(rename('calendar-price-jquery.min.js'))
.pipe(uglify())
.pipe(header('/*! <%= name %> v<%= version %> | (c) <%= author %> | <%= homepage %> */', config))
.pipe(gulp.dest('./dist/js'))
})
// stylus
gulp.task('stylus', function () {
return gulp.src('./src/stylus/calendar-price-jquery.styl')
.pipe(cssBase64())
.pipe(stylus({
compress: true
}))
.pipe(rename('calendar-price-jquery.min.css'))
.pipe(header('/*! <%= name %> v<%= version %> | (c) <%= author %> | <%= homepage %> */', config))
.pipe(gulp.dest('./dist/css'))
})
gulp.task('watch', function () {
gulp.watch('./src/js/*.js', ['uglify'])
gulp.watch('./src/stylus/*.styl', ['stylus'])
})
gulp.task('build', ['uglify', 'stylus'])
gulp.task('dev', ['uglify', 'stylus', 'watch'])