1
votes

Im looking for a way to minify my extjs app. The app has already (and will have more) 100+ files like views etc which are loading on the launch and I heard that using a Sencha CMD to minify it would be a good idea, when the app will finally get to production.

Unfortunately, Ive ran into some problems while using the Sencha cmd. Here's what I did:

  1. downloaded the app to my local
  2. installed sencha cmd v5.1.2.52

Now I try to simply do 'sencha app build', like the tutorials say. It throws me an error [ERR] Command must be run from an app or package folder.

Already tried doing it in main folder, but also tried in "app" inside it. Always the same error.

I probably missed something, because I read about the .sencha folder, it probably should be in my application's folder, but it isnt. Maybe its because of that?

I've also seen a solution to do a 'sencha app init' (thought it could generate some init folders like .sencha) but the command doesnt exists (maybe it would work on older sencha cmd?).

If someone could be that nice and provide me some steps I should take, or point me the steps I missed, itd be very helpful. I did search for it, most of infos say the 'sencha app build' should work but it didn't, Ive also ran into the 'Sencha SDK' but people says its outdated.

2

2 Answers

0
votes

It sounds like you're missing the metadata that Cmd needs to run an application build.

Try generating a new "app" with Sencha Cmd via the sencha generate app command in a new folder. Then copy your existing application into this folder (replacing the app.js file, /app/ and other bits).

Then try building your application using sencha app build

1
votes

If you want to use this facility,first you must use Compiler-Friendly Code Guidelines include:

  1. Framework Awareness
  2. Code Organization
  3. Class Declaration
  4. ...

Read more: http://docs-origin.sencha.com/cmd/5.x/cmd_compiler.html