在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):geekflyer/gulp-ui5-preload开源软件地址(OpenSource Url):https://github.com/geekflyer/gulp-ui5-preload开源编程语言(OpenSource Language):JavaScript 100.0%开源软件介绍(OpenSource Introduction):
gulp-ui5-preloadCreates a Component-preload.js or library-preload.json file for openui5 / sapui5 projects. Creating a preload file can speed up the initial load time of your webapp, by reducing the number of HTTP requests / roundtrips to load your code. The preload file can combine your Install$ npm install --save-dev gulp-ui5-preload UsageSimple example. var ui5preload = require('gulp-ui5-preload');
gulp.task('ui5preload', function(){
return gulp.src([
'src/ui/**/**.+(js|xml)',
'!src/ui/thirdparty/**' //exclude files that don't belong in preload (optional)
])
.pipe(ui5preload({base:'src/ui',namespace:'my.project.ui'}))
.pipe(gulp.dest('dist'));
}) Example with uglify / minify js and xml. // npm install --save-dev gulp-ui5-preload gulp-uglify gulp-pretty-data gulp-if
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([
'src/ui/**/**.+(js|xml)',
'!src/ui/thirdparty/**'
])
.pipe(gulpif('**/*.js',uglify())) //only pass .js files to uglify
.pipe(gulpif('**/*.xml',prettydata({type:'minify'}))) // only pass .xml to prettydata
.pipe(ui5preload({base:'src/ui',namespace:'my.project.ui'}))
.pipe(gulp.dest('dist'));
}) APIui5Preload(options) -> vinyl through-streamAccepts an options object. Returns a vinyl through-stream which collects all .xml and .js files and emits a single vinyl file (Component-preload.js / library-preload.json) which is passed downstream. optionsbase
The base / entry path of your app. Usually the same location where your index.html and the Component.js resides. Can also be just namespace
The namespace at the fileName
File name of the combined file to emit. isLibrary
If set to LicenseApache 2.0 © Christian Theilemann |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论