gulp-ui5-eager-preload

1.19.5 • Public • Published

gulp ui5 eager preload plugin

npm version

Please use this module by The ultimate generator for UI5

features

  • preload standard modules (with uglify, only preload used modules).
  • allow manually maintain resources & module.
  • generate index.html, inline library.css avoid xhr block request.
  • local file & url based cache.
  • enable use thirdparty library from node_modules

in standard openui5 workthrough demo

  • totally downloaded file size will reduce %50 or more (depends on the usage rate for single standard library).
  • first screen time dropped from 1500ms to 300ms (with cache).
  • reduce the number of requests.

sample configuration

 
eagerPreload({
  // Current Project Title
  title: "UI5 Project",
  // theme
  theme: "sap_belize",
  // standard library resource root
  ui5ResourceRoot: "https://openui5.hana.ondemand.com/resources",
  // enable preload logic
  preload: true,
  // offline mode, will not load resource from ui5 resource root directly
  offline: true,
  sourceDir: join(__dirname, "./src"),
  // thirdparty library output library
  thirdpartyLibPath: "_thirdparty",
  // project namespace
  projectNameSpace: namespace,
  // additionalResources
  additionalResources: [
    "sap/m/messagebundle_zh_CN.properties",
    "sap/ui/core/messagebundle_zh_CN.properties"
  ],
  // boot script
  bootScriptPath: "./index.js",
  // additionalModules 
  // sometimes ui5 will dynamic load resource
  // just use devtools find them and add them to here
  additionalModules: ["sap/m/routing/Router", "sap/ui/thirdparty/datajs"]
})
 

Readme

Keywords

none

Package Sidebar

Install

npm i gulp-ui5-eager-preload

Weekly Downloads

6

Version

1.19.5

License

MIT

Unpacked Size

183 kB

Total Files

25

Last publish

Collaborators

  • suntao