0.1.0 • Published 9 years ago
gulp-openui5-preload v0.1.0
Information
Basic Usage
This will merge all files from a standard SAPUI5/OpenUI5 application into a single preload file.
var gulp = require('gulp');
var ui5Preload = require('gulp-openui5-preload');
gulp.task('preload', function() {
return gulp.src([
'WebContent/**/*.*'
])
.pipe(ui5Preload())
.pipe(gulp.dest('./dist/'));
});
Advanced Usage
Example with compression applied to files before creation of preload file along with specifying directory namespace.
var gulp = require('gulp');
var merge = require('merge2');
var uglify = require('gulp-uglify');
var prettyData = require('gulp-pretty-data');
var ui5Preload = require('gulp-openui5-preload');
gulp.task('preload', function() {
return merge(
// JS Files
gulp.src([
'WebContent/**/*.js'
]).pipe(uglify()),
// XML Files
gulp.src([
'WebContent/**/*.fragment.xml',
'WebContent/**/*.view.xml'
]).pipe(prettyData({
type: 'minify'
})),
// Others
gulp.src([
'WebContent/**/*.fragment.html',
'WebContent/**/*.fragment.json',
'WebContent/**/*.view.html',
'WebContent/**/*.view.json',
'WebContent/**/*.properties'
])
)
.pipe(ui5Preload({
prefix: 'example/app'
}))
.pipe(gulp.dest('./dist/'));
});
Options
prefix
Type: string
Default:
Directory namespace prefix that should be prepended to all found paths. This is useful if the source folder structure is not the same as the module namespace.
LICENSE
(MIT License) 2015 Edward Smyth
0.1.0
9 years ago