FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
BookStack/gulpfile.js at master · ApeWare/BookStack · GitHub
ApeWare
/
BookStack
Public
forked from
BookStackApp/BookStack
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
BookStack
/
gulpfile.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
77 lines (63 loc) · 2.33 KB
Breadcrumbs
BookStack
/
gulpfile.js
Copy path
File metadata and controls
77 lines (63 loc) · 2.33 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
68
69
70
71
72
73
74
75
76
77
'use strict'
;
const
argv
=
require
(
'yargs'
)
.
argv
;
const
gulp
=
require
(
'gulp'
)
,
plumber
=
require
(
'gulp-plumber'
)
;
const
autoprefixer
=
require
(
'gulp-autoprefixer'
)
;
const
uglify
=
require
(
'gulp-uglify'
)
;
const
minifycss
=
require
(
'gulp-clean-css'
)
;
const
sass
=
require
(
'gulp-sass'
)
;
const
browserify
=
require
(
"browserify"
)
;
const
source
=
require
(
'vinyl-source-stream'
)
;
const
buffer
=
require
(
'vinyl-buffer'
)
;
const
babelify
=
require
(
"babelify"
)
;
const
watchify
=
require
(
"watchify"
)
;
const
envify
=
require
(
"envify"
)
;
const
gutil
=
require
(
"gulp-util"
)
;
const
liveReload
=
require
(
'gulp-livereload'
)
;
if
(
argv
.
production
)
process
.
env
.
NODE_ENV
=
'production'
;
let
isProduction
=
argv
.
production
||
process
.
env
.
NODE_ENV
===
'production'
;
gulp
.
task
(
'styles'
,
(
)
=>
{
let
chain
=
gulp
.
src
(
[
'resources/assets/sass/**/*.scss'
]
)
.
pipe
(
plumber
(
{
errorHandler
:
function
(
error
)
{
console
.
log
(
error
.
message
)
;
this
.
emit
(
'end'
)
;
}
}
)
)
.
pipe
(
sass
(
)
)
.
pipe
(
autoprefixer
(
'last 2 versions'
)
)
;
if
(
isProduction
)
chain
=
chain
.
pipe
(
minifycss
(
)
)
;
return
chain
.
pipe
(
gulp
.
dest
(
'public/css/'
)
)
.
pipe
(
liveReload
(
)
)
;
}
)
;
function
scriptTask
(
watch
=
false
)
{
let
props
=
{
basedir
:
'resources/assets/js'
,
debug
:
true
,
entries
:
[
'global.js'
]
,
fast
:
!
isProduction
,
cache
:
{
}
,
packageCache
:
{
}
,
}
;
let
bundler
=
watch
?
watchify
(
browserify
(
props
)
,
{
poll
:
true
}
)
:
browserify
(
props
)
;
if
(
isProduction
)
{
bundler
.
transform
(
envify
,
{
global
:
true
}
)
.
transform
(
babelify
,
{
presets
:
[
'es2015'
]
}
)
;
}
function
rebundle
(
)
{
let
stream
=
bundler
.
bundle
(
)
;
stream
=
stream
.
pipe
(
source
(
'common.js'
)
)
;
if
(
isProduction
)
stream
=
stream
.
pipe
(
buffer
(
)
)
.
pipe
(
uglify
(
)
)
;
return
stream
.
pipe
(
gulp
.
dest
(
'public/js/'
)
)
.
pipe
(
liveReload
(
)
)
;
}
bundler
.
on
(
'update'
,
function
(
)
{
rebundle
(
)
;
gutil
.
log
(
'Rebundling assets...'
)
;
}
)
;
bundler
.
on
(
'log'
,
gutil
.
log
)
;
return
rebundle
(
)
;
}
gulp
.
task
(
'scripts'
,
(
)
=>
{
scriptTask
(
false
)
}
)
;
gulp
.
task
(
'scripts-watch'
,
(
)
=>
{
scriptTask
(
true
)
}
)
;
gulp
.
task
(
'default'
,
[
'styles'
,
'scripts-watch'
]
,
(
)
=>
{
liveReload
.
listen
(
)
;
gulp
.
watch
(
"resources/assets/sass/**/*.scss"
,
[
'styles'
]
)
;
}
)
;
gulp
.
task
(
'build'
,
[
'styles'
,
'scripts'
]
)
;
Back
|
FazBrowse Home
|
New Git URL