-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathgulpfile.coffee
More file actions
31 lines (24 loc) · 925 Bytes
/
gulpfile.coffee
File metadata and controls
31 lines (24 loc) · 925 Bytes
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
gulp = require('gulp')
webpack = require('webpack-stream')
shelljs = require('shelljs')
named = require('vinyl-named')
coffee = require('gulp-coffee')
gutil = require('gulp-util')
EXTENSION_PATH = 'build/Shortly.safariextension'
gulp.task 'clean', ->
shelljs.rm '-rf', './build'
gulp.task 'build:static', ->
gulp.src(['static/*', 'static/*/*'])
.pipe gulp.dest(EXTENSION_PATH)
gulp.task 'build:js', ->
gulp.src(['source/app.js', 'source/libs.js'])
.pipe named()
.pipe webpack( require('./webpack.config') )
.pipe gulp.dest(EXTENSION_PATH + '/js')
gulp.src(['source/injected/*.coffee'])
.pipe coffee().on('error', gutil.log)
.pipe gulp.dest(EXTENSION_PATH + '/js/injected')
gulp.task('build', ['clean', 'build:static', 'build:js'])
gulp.task 'watch', ['build'], ->
gulp.watch(['static/*', 'static/*/*'], ['build:static'])
gulp.watch(['source/*', 'source/*/*'], ['build:js'])