@@ -53,7 +53,8 @@ function watchTemplates () {
53
53
}
54
54
55
55
56
- const staticFiles = 'src/**/*.{xml,html,xq,xqm,xsl,xconf,json,svg,js,css,png,jpg,map}'
56
+ const staticFiles = 'src/**/*.{xml,html,xq,xqm,xsl,xconf,json,svg,js,css,map}'
57
+ const images = 'src/**/*.{png,jpg}'
57
58
58
59
/**
59
60
* copy html templates, XSL stylesheet, XMLs and XQueries to 'build'
@@ -66,6 +67,17 @@ function watchStatic () {
66
67
watch ( staticFiles , series ( copyStatic ) ) ;
67
68
}
68
69
70
+ /**
71
+ * copy images to 'build'
72
+ */
73
+ function copyImages ( ) {
74
+ return src ( images , { encoding : false } ) . pipe ( dest ( 'build' ) )
75
+ }
76
+
77
+ function watchImages ( ) {
78
+ watch ( images , series ( copyImages ) ) ;
79
+ }
80
+
69
81
/**
70
82
* Upload all files in the build folder to existdb.
71
83
* This function will only upload what was changed
@@ -90,7 +102,7 @@ const xarFilename = `${app.abbrev}-${version}.xar`
90
102
* create XAR package in repo root
91
103
*/
92
104
function createXar ( ) {
93
- return src ( 'build/**/*' , { base : 'build/' } )
105
+ return src ( 'build/**/*' , { base : 'build/' , encoding : false } )
94
106
. pipe ( zip ( xarFilename ) )
95
107
. pipe ( dest ( 'dist' ) )
96
108
}
@@ -99,7 +111,7 @@ function createXar () {
99
111
* upload and install the latest built XAR
100
112
*/
101
113
function installXar ( ) {
102
- return src ( xarFilename , { cwd :'dist/' , encoding : false } )
114
+ return src ( xarFilename , { cwd :'dist/' , encoding : false } )
103
115
. pipe ( existClient . install ( { packageUri } ) )
104
116
}
105
117
@@ -108,11 +120,13 @@ function installXar () {
108
120
const build = series (
109
121
clean ,
110
122
templates ,
111
- copyStatic
123
+ copyStatic ,
124
+ copyImages
112
125
)
113
126
const deploy = series ( build , deployApp )
114
127
const watchAll = parallel (
115
128
watchStatic ,
129
+ watchImages ,
116
130
watchTemplates ,
117
131
watchBuild
118
132
)
@@ -126,6 +140,8 @@ export {
126
140
watchTemplates ,
127
141
copyStatic ,
128
142
watchStatic ,
143
+ copyImages ,
144
+ watchImages ,
129
145
build ,
130
146
deploy ,
131
147
xar ,
0 commit comments