【问题标题】:ExtJs minify also external librariesExtJs 也缩小了外部库
【发布时间】:2015-05-19 10:28:05
【问题描述】:

我正在使用 ExtJs 5.1。

我已经通过 app.json 向应用程序添加了一些外部库,只需使用 "path": "libPath"

一切正常,但当我运行时

sencha app build production

cmd 也尝试缩小外部库。如果被 Sencha 缩小,我的一些外部库会转到 Js Exception。

如何让 sencha cmd 只构建和缩小 extjs 代码并复制外部库而不进行编辑?

如果我跑

sencha app build testing

一切正常。

非常感谢

【问题讨论】:

    标签: javascript extjs extjs5 sencha-cmd5


    【解决方案1】:

    查看js数组周围的app.json cmets:

        /**
     * 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
        }
    ],
    

    我认为"includeInBundle" : false, 可能会为您解决问题。

    【讨论】:

      【解决方案2】:

      您是否将外部库放在应用程序的资源文件夹中?这通常只是按原样包含在内。

      【讨论】:

        猜你喜欢
        • 2012-06-26
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-02-10
        • 2011-01-01
        • 2017-05-05
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多