3

Does anyone know how to remove compression of javascript file in sencha cmd? I want that my production app.js file what fully readable.

And I want to configure this in my app.json if possible.

I did this:

/**
 * Settings specific to production builds.
 */
"production": {
    "compressor": null, // compressor null
    "output": {
        "js": {
            "optimize": false, // optimize false
        },
        "appCache": {
            "enable": false,
            "path": "../cache.appcache"
        }
    },
    "loader": {
        "cache": "${build.timestamp}"
    },
    "cache": {
        "enable": false
    }
}

But whereas the compressor option work, at the end my file is still "compressed" (not minified but still in one line).

I try the optimize method in the ideal situation, I would like all Sencha Cmd optimization to be perform except to shrink everything in one line...

If somebody know.

Thanks in advance!

Psycho
  • 381
  • 1
  • 17

3 Answers3

3

thanks to @bnz, the proposed answer was not fully right but it helps me found the solution.

So, to disable the last compression of the app.js file during the build process, you have to go to your <appFolder>/.sencha/app/production.properties and this directive:

enable.resource.compression=false

I did not found yet how to set this in the app.json

Psycho
  • 381
  • 1
  • 17
2

No answer worked for me, but I found further possible solutions at Sencha Forum (that worked): https://www.sencha.com/forum/showthread.php?315722-How-to-ignore-compression-in-production-build

I leave it here for future people reaching this thread :)

[copied from the link]

  • Sencha Cmd v6.5.3.16:

app.json:

"production": {
    "compressor": {
        "type": "none"
    }
}

To disable optimizations:

"output": {
    "js": {
        "optimize": false
    }
}
  • Sencha Cmd 6.2.2.36 (change all the following):

app.json:

"production": {
    "compressor": {
        "type": "none"
    }
}

.sencha/app/production.properties:

enable.resource.compression=false
Alfonso Nishikawa
  • 1,876
  • 1
  • 17
  • 33
1

Using app.json you can add

"debug" : {
   "enable":false/true
}

to your production build object.

If you wanna disable this in general, until the next app upgrade, you can have a look under

.sencha/app/production.defaults.properties

OR better to overwrite the settings

.sencha/app/production.properties

You need to set

build.options.debug=true

there.

hwsw
  • 2,596
  • 1
  • 15
  • 19