forked from arianrhodsandlot/devdocs-web-ext
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.babel.js
51 lines (49 loc) · 1.31 KB
/
gulpfile.babel.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
import gulp from 'gulp'
import jade from 'gulp-jade'
import stylus from 'gulp-stylus'
import babel from 'gulp-babel'
import uglify from 'gulp-uglify'
import nib from 'nib'
import del from 'del'
gulp
.task('jade', () => {
gulp.src('./app/pages/*.jade')
.pipe(jade())
.pipe(gulp.dest('./app/pages/build'))
})
.task('stylus', () => {
gulp.src('./app/styles/*.styl')
.pipe(stylus({
use: nib(),
compress: true,
import: 'nib'
}))
.pipe(gulp.dest('./app/styles/build'))
})
.task('babel', function() {
gulp.src('./app/scripts/*.js?(x)')
.pipe(babel())
.pipe(gulp.dest('./app/scripts/build'));
})
.task('watch', () => {
gulp.watch('./app/pages/*.jade', ['jade'])
gulp.watch('./app/styles/*.styl', ['stylus'])
gulp.watch('./app/scripts/*.js?(x)', ['babel'])
})
.task('cp', () => {
gulp.src([
'./node_modules/backbone/backbone.min.js',
'./node_modules/jquery/dist/jquery.min.js',
'./node_modules/lodash/lodash.min.js'
])
.pipe(gulp.dest('./app/components'))
})
.task('default', ['cp', 'jade', 'stylus', 'babel', 'watch'])
gulp
.task('pack', () => {
del('crx', () => {
gulp
.src(['./app/**/*', '!./app/**/*.styl', '!./app/**/*.jade'])
.pipe(gulp.dest('./crx'))
})
})