forked from 6of5/UI5-Boilerplate-Fiori
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
31 lines (29 loc) · 974 Bytes
/
gulpfile.js
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
var gulp = require('gulp');
var ui5preload = require('gulp-ui5-preload');
var uglify = require('gulp-uglify');
var prettydata = require('gulp-pretty-data');
var gulpif = require('gulp-if');
gulp.task(
'ui5preload',
function() {
return gulp.src(
[
'**/**.+(js|xml)',
'!Component-preload.js',
'!gulpfile.js',
'!WEB-INF/web.xml',
'!model/metadata.xml',
'!node_modules/**',
'!resources/**'
]
)
.pipe(gulpif('**/*.js', uglify())) //only pass .js files to uglify
.pipe(gulpif('**/*.xml', prettydata({type: 'minify'}))) // only pass .xml to prettydata
.pipe(ui5preload({
base: './',
namespace: 'ui5bp',
fileName: 'Component-preload.js'
}))
.pipe(gulp.dest('.'));
}
)