-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
37 lines (32 loc) · 1.07 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
var gulp = require('gulp');
var stylus = require('gulp-stylus');
var browserify = require('browserify');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
var sourcemaps = require('gulp-sourcemaps');
var gutil = require('gulp-util');
var nop = require('gulp-nop');
var vueify = require('vueify');
var patelify = require('patelify');
gulp.task('css-glyphs', function() {
return gulp.src('./styles/glyphs/*.styl')
.pipe(stylus({ compress: true }))
.pipe(gulp.dest('./static/glyphs/'));
});
gulp.task('js-glyphs', function() {
var b = browserify({
entries: './scripts/glyphs/main.js',
transform: [patelify, vueify],
extensions: ['.vue', '.patel', '.ptl']
})
return b.bundle()
.pipe(source('main.js'))
.pipe(buffer())
.pipe(sourcemaps.init({loadMaps: true}))
.pipe(uglify()) .on('error', gutil.log)
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest('./static/glyphs/'))
});
gulp.task('default', ['css-glyphs', 'js-glyphs']);