2015-04-02 86 views
0

在ExtJs 4.2中,我总是在开发环境中使用ext-debug.js。与ext-all-debug.js相比,优势在于每个类都作为单独的文件加载,因此开发人员工具中的回溯更加清晰。如何在ExtJs 5.0中使用ext-debug.js?

我做了升级,从4.2 ExtJS的5.1,我的app.json样子:

/** 
* Comma-separated string with the paths of directories or files to search. Any classes 
* declared in these locations will be available in your class "requires" or in calls 
* to "Ext.require". The "app.dir" variable below is expanded to the path where the 
* application resides (the same folder in which this file is located). 
*/ 
"classpath": "${app.dir}/app", 
/** 
* The Sencha Framework for this application: "ext" or "touch". 
*/ 
"framework": "ext", 
"js": [ 
    { 
     "path": "${framework.dir}/build/ext-all-rtl-debug.js" 
    }, 
    { 
     "path": "app.js", 
     "bundle": true 
    } 
], 

当我改变行

"path": "${framework.dir}/build/ext-debug.js" 
  • 煎茶建立与此failes错误

    [INF] Capturing theme image 
    [ERR] loading page W%3A/mbgest25dev/sass/example/theme.html 
    registering ready listener... 
    [E] [Ext.Loader] Some requested files failed to load. 
    ... dozens of times the same error 
    
  • ext-debug.js被加载,但所有的类都装载了错误的URL(并获得404错误) GET http://example.com/packages/sencha-core/src/class/Mixin.js?_dc=1427986581354代替GET http://example.com/app-directory/ext/packages/sencha-core/src/class/Mixin.js?_dc=1427986581354

当然,在sencha app build的误差比在浏览器中一样。

必须有一个缺失配置,告知ext-debug.js在哪里查找框架,而ext-all-rtl-debug.js不需要知道。

如何配置ExtJs 5.0以使ext-debug.js能够从更清晰和更相关的堆栈跟踪中受益?

编辑:

添加路径EXT框架类的classpath"classpath": "${app.dir}/app,${app.dir}/ext",没有帮助。 sencha cmd给出了一些警告,最终无法构建应用程序。

回答

0

这种配置可以在三个地方进行处理,通常是按以下顺序:

  • .sencha/sencha.cfg
  • app.json
  • app.js(或的application.js)

如果您是从Ext JS 4进行升级,那么很有可能在sencha.cfg中。寻找app.frameworkapp.classpath

接下来检查app.json,并查找可能覆盖此设置的相同设置。如果一切都失败了,请尝试使用路径属性(对象映射命名空间到目录结构),将它们设置为针对app.js中的Ext.application,以强制路径。

+1

包含在应用程序中的文档。json说**框架**应该是'ext'或'sencha'。另一方面**类路径**告诉加载器应该在哪里查找应用程序的类。在我的情况下,它是''classpath“:”$ {app.dir}/app“'。添加'$ {framework.dir}'或'$ {app.dir}/ext'对我来说没有意义,是不是?我会试一试,但我很怀疑。 – 2015-04-06 12:21:00

+0

我尝试了你的建议,但是我无法让它工作。请参阅编辑。也许你可以提供一些更具体的建议? – 2015-04-06 13:12:05

+0

刷新/编译应用程序后,您能向我们展示bootstrap.json的输出吗?在你的基础软件包目录没有正确设置的地方,很难说没有看到你的一些配置文件。 – OhmzTech 2015-04-06 15:28:59

2

如果您删除这些行

{ 
     "path": "${framework.dir}/build/ext-all-rtl-debug.js" 
} 

在app.json你会实现你想要什么(分机将加载所需的类什么是写在你的bootstrap.json文件)。

+0

非常感谢。这阻止了我升级我的应用程序到ExtJs 5,同时ExtJs6.0出来了。我现在无法检查你的答案是否正确,但当然这允许我在某些时候尝试升级到Ext 6.0。 – 2016-01-14 10:17:09