Skip to Content

Sapui5 minify files with grunt / uglify

Feb 12 at 11:32 AM


avatar image

I'm trying to get one of my sapui5 apps minified on the Fiori launchpad. But I'm facing some troubles. My minified files seem to be going in a 'tmp' folder and are not seen in the Fiori launchpad. I do get some dbg files, but next to the normal files which aren't minified. So the minified files are not used, but the normal files are. I do have a minified component preload. Anyone have any advise on what I'm doing wrong?

This is my gruntfile.js I'm using at the moment,

module.exports = function(grunt) {
    'use strict';
    // Project configuration.
        uglify: {
            options: {
                mangle: true,
                compress: {
                    drop_console: true,
                    dead_code: false,
                    unused: false
            files: {
                expand: true,
                cwd: "<%= ref.staging%>",
                src: ["**/*.js", '!test/**', '!test_local.html'],
                dest: "<%= ref.process%>"
    grunt.registerTask('default', [

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Emanuele Ricci Feb 13 at 10:44 AM

Why do you need to minify it? The build task should already create Component-preload.js (that minify your code)

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Emanuele, I see it does that, but it somehow also loads the entire applications with files which aren't minified. In my understanding these should not be loaded when not used or loaded minified. That's what I'm trying to accomplish.