1
votes

I have an Extjs application that I have retrofitted into a Sencha Cmd generated app to be able to minify & concatenate js and css files. The build process runs fine but I see the following errors when I run the application. enter image description here

The lines corresponding to the error are: enter image description hereand enter image description here

I guess my 2 questions are :

  1. Is Sencha Cmd the only reliable way to minify & concatenate all files of an extjs application? I have tried using Yuicompressor to minify individual files and concatenate manually , however I was not able to figure out how to easily manage dependencies of the extJS application.
  2. How can I get around the issue above with the build generated with Sencha cmd? Is there something that I am missing?

I am using ExtJS 4.2.1 and Sencha Cmd 4(have tried with 5 as well).

1
Try to debug it using ext-all-debug.js instead of ext-all.js. You can find more info. Coming your questions, 1. Sencha Cmd is not the only one which minifies your application, there are dozens of softwares available, I prefer code.google.com/p/webutilities, you can use yui.github.io/yuicompressor or any other minification tool. - Bala
@Bala Thanks for your response. I have tried yuicompressor, but managing the dependency chain of a complex ExtJS application is difficult. I have updated my question with this. I will checkout webutilities. - ss_everywhere

1 Answers

0
votes

Ok I was able to answer both questions more or less:

  1. Sencha Cmd manages ext dependencies well and also uses yuicompressor internally to minify the js. Retrofitting an existing application into a sencha cmd application works fine if the requries: config is correctly specified in the extjs files.
  2. The issue above was due to a bad copy paste. I had left some unnecessary statements in one of my views which seemed to cause the above issue. Basically I was trying to query an un-instantiated view. On removing these statements and rebuilding the (minified) application works fine.