-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathgulpfile.js
35 lines (30 loc) · 1017 Bytes
/
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
var gulp = require('gulp')
var browserify = require('browserify')
var jadeify = require('jadeify')
var babelify = require('babelify')
var buffer = require('vinyl-buffer')
var source = require('vinyl-source-stream')
var stylus = require('gulp-stylus')
var concat = require('gulp-concat-css')
var nib = require('nib')
var minify = require('gulp-minify-css')
var uglify = require('gulp-uglify')
gulp.task('build', ['styl', 'js'])
gulp.task('js', function() {
return browserify({
entries: './lib/app.js', //punto de entrada js
transform: [ babelify, jadeify] //transformaciones
})
.bundle()
.pipe(source('app.js')) // archivo destino
.pipe(buffer())
.pipe(uglify())
.pipe(gulp.dest('./public/')) // en dónde va a estar el archivo destino
})
gulp.task('styl', function() {
return gulp.src('./lib/app.styl') // entry point de styl
.pipe(stylus({ use: nib() })) //inicializo stylus con nib como plugin
.pipe(concat('app.css'))
.pipe(minify())
.pipe(gulp.dest('./public/css'))
})