Tarang
Tarang

Reputation: 75945

Building a Sencha Touch 2.1 project

I've built myself a small Sencha Touch 2 app, so now i'm trying to make it smaller/minify it

My app looks like

/touch
/app.js
/resources
/ux
/app
/app.json
/index.html
/build.xml

So I was trying to make it more efficient & faster to load so I loaded up Sencha Cmd and ran

sencha compile --classpath=app,touch/src,ux include -all

So it does what looks like compiling it, without giving any errors, it gives a few warnings but those are ok. So it finishes up and nothings changed. The directories are exactly as there were before.

How would I use this correctly to make my app smaller & load faster?

Upvotes: 0

Views: 2777

Answers (2)

Alan124
Alan124

Reputation: 31

See Also cmd tool doc for detailed info: http://docs.sencha.com/cmd/3.1.2/#!/guide/command_app_touch-section-deploying-your-application

Deploying your application simply means editing source code and refreshing the browser. All source files are dynamically loaded on demand. There's no building process involved. When it comes to deployment, Sencha Cmd provides the following four build environment options:

testing - intended for QA prior to production. All JavaScript and CSS source files are bundled, but not minified, which makes it easier to debug.

package - creates a self-contained, redistributable production build that normally runs from the local file system without a web server.

production - creates a production build that is normally hosted on a web server and serves multiple clients (devices). The build is offline-capable using HTML 5 application cache, and is enabled to perform over-the-air updates.

native - first generates a package build, then packages it as a native application, ready to be deployed to native platforms.

Upvotes: 0

Sergio Prado
Sergio Prado

Reputation: 1206

The command

sencha app build package

or

sencha app build production

Will minify/package your application. All of the javascript will be contained in a single app.js file, and the javascript+css will be minified. More information about these commands can be found here: http://docs.sencha.com/touch/2-1/#!/guide/command_app

Upvotes: 2

Related Questions