@@ -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'
@@ -62,9 +63,19 @@ function copyStatic () {
62
63
return src ( staticFiles ) . pipe ( dest ( 'build' ) )
63
64
}
64
65
66
+ /**
67
+ * copy html templates, XSL stylesheet, XMLs and XQueries to 'build'
68
+ */
69
+ function copyImages ( ) {
70
+ return src ( images , { encoding : false } ) . pipe ( dest ( 'build' ) )
71
+ }
72
+
65
73
function watchStatic ( ) {
66
74
watch ( staticFiles , series ( copyStatic ) ) ;
67
75
}
76
+ function watchImages ( ) {
77
+ watch ( images , series ( copyImages ) ) ;
78
+ }
68
79
69
80
/**
70
81
* Upload all files in the build folder to existdb.
@@ -90,7 +101,7 @@ const xarFilename = `${app.abbrev}-${version}.xar`
90
101
* create XAR package in repo root
91
102
*/
92
103
function createXar ( ) {
93
- return src ( 'build/**/*' , { base : 'build/' } )
104
+ return src ( 'build/**/*' , { base : 'build/' , encoding : false } )
94
105
. pipe ( zip ( xarFilename ) )
95
106
. pipe ( dest ( 'dist' ) )
96
107
}
@@ -99,7 +110,7 @@ function createXar () {
99
110
* upload and install the latest built XAR
100
111
*/
101
112
function installXar ( ) {
102
- return src ( xarFilename , { cwd :'dist/' , encoding : false } )
113
+ return src ( xarFilename , { cwd :'dist/' , encoding : false } )
103
114
. pipe ( existClient . install ( { packageUri } ) )
104
115
}
105
116
@@ -108,11 +119,13 @@ function installXar () {
108
119
const build = series (
109
120
clean ,
110
121
templates ,
111
- copyStatic
122
+ copyStatic ,
123
+ copyImages
112
124
)
113
125
const deploy = series ( build , deployApp )
114
126
const watchAll = parallel (
115
127
watchStatic ,
128
+ watchImages ,
116
129
watchTemplates ,
117
130
watchBuild
118
131
)
@@ -126,6 +139,8 @@ export {
126
139
watchTemplates ,
127
140
copyStatic ,
128
141
watchStatic ,
142
+ copyImages ,
143
+ watchImages ,
129
144
build ,
130
145
deploy ,
131
146
xar ,
0 commit comments