After working on a project where the connectivity of the pc was not desirable, we came to the conclusion that we needed something more than the component-preload to minimize the load of the application.
In this sense, we decided to minimize the size of the code to load, we conclude that we should generate files with GULP through the minification.
You can generate the component-preloadjs file by following these steps:
We added here the steps that we can find also in the github wiki:
- Install the last version of node.js node.js
- Download files package.json and gulpfile.js Master branch
- Copy this files into your project into WebContent folder
- Configure eclipse to discard node packages when sumbit files to SAP Gateway in “Windows” > “References” > “Team” > “Ignored Resources” and add “node_modules”
- Install gulp dependencies with package.json
- Prepare gulpfile.js for your project. You need to change name of project in gulpfile with your name of project in index.html:
After these stepts you will have a new folder called node_modules, so, the project are ready to generate component-preload.js.
2. Generate Component preload.js
To generate component-preload.js file with task minify js, you only have to execute the task of gulp with the right button of your mouse.
"Gulp Task"" data-index="5" data-id="plbox-515757" />
A few seconds later we have our file 🙂
And we already have our application minimized 😉
For more information *https://www.npmjs.com/package/gulp-minify