cancel
Showing results for 
Search instead for 
Did you mean: 

How to build Component preload for Launchpad Plugin by tooling?

thalesvb
Active Contributor
0 Kudos

Hello all,

I'm developing a Fiori Launchpad Plug-in and I intend to put its repository in a CD pipeline soon. Like a UI5 app, Launchpad Plugins also have a recommendation to Provide a Component Preload file for runtime (Plug-in Development Guildelines on Help Portal).

The problem: WebIDE neither provides a UI5-cli or Grunt file to build Preload by tooling when creating a new FLP Plug-in project.

Question: Anyone out there had success to build preload for Launchpad Plug-in by tooling? Any hints would be helpful.

I'm currently trying to make it buildable in UI5-tooling based on files that work fine for UI5 apps. I had to do a minor change in resources\configuration\paths property since FLP Plug-in have everything on root folder, unlike a UI5 app that puts them on webapp. I'm doing this build test at GitLab pipeline with this ui5yaml.txt and this packagejson.txt (renamed both to txt to allow upload) with a fresh clean FLP project with the commands:

npm install --global @ui5/cli
npm install
ui5 build

The build fails precisely at task generateComponentPreload with a bunch of Unexpected token error (job log exceeds 4MB). This can't be a error from plug-in itself because it was just created from wizard, and works without errors when testing, and both files for UI5-cli looks OK for me.

Best regards

Accepted Solutions (1)

Accepted Solutions (1)

thalesvb
Active Contributor
0 Kudos

If anyone finds this question, my definitive solution was something I said in comments: Change project layout to a better one, which I blogged/documented here at the time. Both UI5 Builder and Grunt worked on that new layout.

Answers (2)

Answers (2)

former_member589040
Discoverer

Hi,

You need to create two files in the project folder:

1. package,json see https://launchpad.support.sap.com/#/notes/0002801814

2. Gruntfile.js:

module.exports = function(grunt) {

"use strict";

grunt.loadNpmTasks("@sap/grunt-sapui5-bestpractice-build");

grunt.registerTask("default", [ "clean", "lint", "build" ]);

};

thalesvb
Active Contributor
0 Kudos

It really built a preload, but had some flaws (used a minimal package.json to check):

  • Grunt didn't take consideration that Component.js was on root folder (same situation that UI5 tooling was having), so it wrote preload on root folder (not dist folder). This difficultes deploy a bit, but it should be some config to enforce write to dist (didn't find yet).
  • Because preload was output to root folder, it skipped some grunt tasks and didn't generate dbg file and manifest bundle.

I lost this notification and on meantime I changed default Plugin project directory layout to ressemble a Normal app (component/manifest inside webapp folder). With that structure the Grunt built without skipping tasks.

Thanks

yunutuzun
Product and Topic Expert
Product and Topic Expert
0 Kudos

I have same problem . Are there any solution ?

thalesvb
Active Contributor
0 Kudos

I reached one temporary solution for UI5 tooling: change project layout to be like a normal app: create webapp folder and move Component/manifest to it. It also required some minor changes to everything works and successfully built with a common ui5.yaml for applications. A fix on Builder is needed to work with root folder projects, I'll open a issue on GitHub.

Gruntfile works (at some point) but its issues are also circumvented by changing project layout, which I do recommend (keep things a bit more organized).