ExtJs minify also external libraries

1.5k views Asked by At

I'm working with ExtJs 5.1.

I've added some external libraries to the app through app.json, simply using "path": "libPath"

All works fine but when I run

sencha app build production

The cmd try to minify also the external libraries. If minified by Sencha some of my external libraries going to Js Exception.

How can I say to sencha cmd to build and minify only extjs code and copy external libraries without editing?

If i run

sencha app build testing

all works fine.

Thanks a lot

2

There are 2 answers

0
arthurakay On

Look at the app.json comments around the js array:

    /**
 * List of all JavaScript assets in the right execution order.
 *
 * Each item is an object with the following format:
 *
 *      {
 *          // Path to file. If the file is local this must be a relative path from
 *          // this app.json file.
 *          //
 *          "path": "path/to/script.js",   // REQUIRED
 *
 *          // Set to true on one file to indicate that it should become the container
 *          // for the concatenated classes.
 *          //
 *          "bundle": false,    // OPTIONAL
 *
 *          // Set to true to include this file in the concatenated classes.
 *          //
 *          "includeInBundle": false,  // OPTIONAL
 *
 *          // Specify as true if this file is remote and should not be copied into the
 *          // build folder. Defaults to false for a local file which will be copied.
 *          //
 *          "remote": false,    // OPTIONAL
 *
 *          // If not specified, this file will only be loaded once, and cached inside
 *          // localStorage until this value is changed. You can specify:
 *          //
 *          //   - "delta" to enable over-the-air delta update for this file
 *          //   - "full" means full update will be made when this file changes
 *          //
 *          "update": "",        // OPTIONAL
 *
 *          // A value of true indicates that is a development mode only dependency.
 *          // These files will not be copied into the build directory or referenced
 *          // in the generate app.json manifest for the micro loader.
 *          //
 *          "bootstrap": false   // OPTIONAL
 *      }
 *
 */
"js": [
    {
        "path": "app.js",
        "bundle": true
    }
],

I think "includeInBundle" : false, might do the trick for you.

0
Johan Van de Merwe On

Have you put the external libraries in resources folder of your app? That is usually just included as it is.