EXT JS 5.1 Minified Core Frame work 开发时 [英] EXT JS 5.1 Minified Core Frame work when developing

查看:10
本文介绍了EXT JS 5.1 Minified Core Frame work 开发时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在开发时,我想使用 Ext JS 5.1 的一个缩小的 .js 文件,就像他们在 Sencha Fiddle 上所做的那样.看起来您可以使用 Sencha 的 cdn 链接,但是当我在索引文件中使用它时,它失败了.

When developing I want to use a a minified .js file of Ext JS 5.1 like they do on Sencha Fiddle. It looks like you can use the cdn link from Sencha but when I use this in the index file it fails.

我需要在 bootstrap.js 文件中做些什么才能使其仅使用链接而不是 Ext Js 5 根文件夹?我想为在企业情况下托管在服务器上的多个应用程序使用相同的链接.

Is there something I need to be doing in the bootstrap.js file to make it use just a link instead of the Ext Js 5 root folder? I want to use the same link for multiple apps hosted on a server for an enterprise situation.

此外,Chrome Dev Tools 运行速度非常慢,必须加载每个文件.我想用一个缩小的文件再次使这个有用.

Also, the Chrome Dev Tools running super slow having to load each file. I want to use one minified file to make this useful again.

推荐答案

我不确定您如何使用 cdn 文件sencha 中引用小提琴网站.在使用微加载器时将该链接直接添加到应用程序会导致错误.extjs5 中的微加载器会自动找出框架中要加载的文件.

I'm not positive how you could use the cdn file referenced in the sencha fiddle website. Adding that link directly to the app while using the microloader would cause errors. The microloader in extjs5 automatically figures out which files to load in the framework.

但是,如果您使用 sencha cmd,您可以使用 extjs 框架的缩小版本来实现类似的目标.

他们详细说明如何设置您的项目以使用 extjs5 的缩小版或开发者副本,而不是加载此论坛帖子中的所有单独文件

以下是对您的项目进行的更改记录到堆栈溢出,以防论坛帖子不再可用:

Here are the changes to make to your project documented to stack overflow in case that forum post is no longer available:

第一步

确保您使用的 sencha cmd 版本高于 5.0.2.
要确定您的 sencha cmd 版本,您可以在命令提示符中键入以下内容:

make sure you are using a version of sencha cmd greater than 5.0.2.
To determine your version of sencha cmd you can type the following in the command prompt:

sencha which

如果您有旧版本的 sencha cmd,您可以在这里下载最新版本

感谢 Niederee 提供的这个小建议,请对您的应用进行 sencha 应用升级,以确保它与最新的 sencha 命令构建相关联

Thanks to Niederee for this little advice, do a sencha app upgrade on your app to make sure it's tied to the latest sencha command build

sencha 应用升级

第二步

调整您的 app.json 清单文件以加载 ext-all-rtl-debug.js .将此文件添加到文件中的 "js":[] 数组中:

Adjust your app.json manifest file to load the ext-all-rtl-debug.js . Add this file to the "js":[] array in the file:

"js": [
        {
            "path": "${ext.dir}/build/ext-all-rtl-debug.js"  // new default for generated apps
        },
        {
            "path": "app.js",
            "bundle": true
        }
    ],

您也可以添加 sencha 图表,如果它们也需要获得缩小的构建:

You can also add sencha charts if they are required to get that minified build too:

        {
            "path": "${ext.dir}/packages/sencha-charts/build/sencha-charts-debug.js"
        },

可选地,您还可以根据开发/生产调整缓存首选项将此额外添加到 app.json 文件中:

Optionally you can also adjust the cache preferences based on dev/production Add this additionally to the app.json file:

"development": {
        "loader": {
            "cache": true
        }
    },
    "production": {
        "loader": {
            "cache": "${build.timestamp}"
        }
    }

第三步在命令提示符下运行以下 sencha 命令以刷新应用程序的引导清单.

Step Three In the command prompt run the following sencha command to refresh your application's bootstrap manifest.

sencha app refresh

这篇关于EXT JS 5.1 Minified Core Frame work 开发时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆