-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.coffee
67 lines (57 loc) · 1.56 KB
/
gulpfile.coffee
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
autoprefixer = require 'gulp-autoprefixer'
browserify = require 'browserify'
gulp = require 'gulp'
gutil = require 'gulp-util'
minifyCSS = require 'gulp-minify-css'
plumber = require 'gulp-plumber'
source = require 'vinyl-source-stream'
uglify = require 'gulp-uglify'
vulcanize = require 'gulp-vulcanize'
generateThemes = require './scripts/generate-themes-file.js'
paths =
css: "css/*.css"
assets: "assets/*"
onError = (error) ->
gutil.beep()
console.log error
gulp.task 'browserify', ->
browserify 'components/markdown-editor.js'
.bundle()
.pipe source 'markdown-editor-bundled.js'
.pipe gulp.dest 'components'
gulp.task 'css', ->
gulp.src paths.css
.pipe plumber
errorHandler: onError
.pipe autoprefixer()
.pipe minifyCSS()
.pipe gulp.dest 'release/css'
gulp.task 'assets', ->
gulp.src paths.assets
.pipe plumber
errorHandler: onError
.pipe gulp.dest 'release/assets'
gulp.task 'background', ->
gulp.src "background.js"
.pipe plumber
errorHandler: onError
.pipe uglify()
.pipe gulp.dest 'release'
gulp.task 'manifest', ->
gulp.src "manifest.json"
.pipe plumber
errorHandler: onError
.pipe gulp.dest 'release'
gulp.task 'generate-themes', ->
generateThemes()
gulp.task 'html', ['browserify', 'generate-themes'], ->
gulp.src "index.html"
.pipe plumber
errorHandler: onError
.pipe vulcanize
dest: 'release',
strip: true,
inline: true,
csp: true
.pipe gulp.dest 'release'
gulp.task 'default', ['css', 'assets', 'manifest', 'background', 'html']