EXT JS 5.1开发中的精简Core Frame工作 [英] EXT JS 5.1 Minified Core Frame work when developing

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

问题描述

当我开发我想要使用Ext JS 5.1的一个最小化的.js文件,就像他们在Sencha Fiddle上一样。看起来你可以使用来自Sencha的cdn链接,但是当我在索引文件中使用它时,它会失败。



我需要在bootstrap.js文件中进行某些操作,使其仅使用一个链接而不是Ext Js 5根文件夹?我想为服务器上托管的多个应用程序使用相同的链接,用于企业情况。



此外,运行速度较慢的Chrome开发工具必须加载每个文件。我想使用一个最小化的文件来再次有用。

解决方案

我不太乐意如何使用 cdn文件 sencha小提琴网站。在使用微型加载器时将该链接直接添加到应用程序会导致错误。 extjs5中的微型加载器自动计算出框架中要加载的文件。



但是,您可以实现类似的目标,即使用extjs框架的最小化版本如果您使用sencha cmd。



他们详细介绍如何设置项目以使用extjs5的最小化或开发人员副本,而不是在此论坛帖子中加载所有单独的文件。 a>



以下是对您的项目进行的更改文档,以堆栈溢出,以防止论坛帖子不再可用



第一步



确保您使用的版本是sencha cmd 更大比 5.0.2

要确定您的sencha cmd的版本,您可以在命令提示符下键入以下内容:

  sencha其中

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



感谢Niederee的这个小小的建议,在您的应用程序上执行一个sencha应用程序升级,以确保它绑定到最新的sencha命令构建

sencha app upgrade



第二步



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

 js:[
{
path:$ {ext.dir} /build/ext-all-rtl-debug.js//生成应用程序的新的默认值
$,
{
path:app.js,
bundle:true
}
],

如果需要,也可以添加sencha图表:

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

您还可以根据dev / production调整缓存首选项
另外添加到 app.json 文件:

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

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

  sencha应用程序刷新


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.

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.

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.

解决方案

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.

However, you can achieve a similar goal of using a minified version of the extjs framework if you are using sencha cmd.

They detail how to setup your project to use the minified or developer copy of extjs5 instead of loading all the seperate files in this forum post

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

Step One

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

If you have an older version of sencha cmd you can download the latest copy here

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 upgrade

Step Two

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

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"
        },

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}"
        }
    }

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开发中的精简Core Frame工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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