Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sencha app build production: doesn't combine my js

So... as I have read through the Sencha Command documentation, it tells me that the build will automagically (using Phantom JS) be able to tell me what all of my dependencies are, and in what order. Based off of that, I am expecting the "sencha app build production" command to concatenate all of my dependencies into one js file, regardless of whether I have manually included them in the app.json file. However, I am not seeing this happen.

Do I have to manually maintain a list of JS files in the app.json? If so, then that is fine. I just have understood different from the documentation. Please help.

edit--
So my index.html is very minimal. It only has a script tag to one external resource js file, and one script tag to the 'sdk/microloader/development.js'. My app.js isn't referenced on my index.html. When I terminal into my app dir and run the "sencha app build production" command, it finishes without an error. However, it only finds 53 dependencies, when I know that we have well over 500. Here is the output in the terminal when I run the build:

aaronfrost@topnotch ~/source/ab/AreaBook/web/src/main/webapp/sencha2 $ sencha app build -e production 
[INFO] Deploying your application to /home/aaronfrost/source/ab/AreaBook/web/src/main/webapp/sencha2/build/production
[INFO] Copied sdk/sencha-touch.js
[INFO] Copied app.js
[INFO] Copied resources/css/app.css
[INFO] Copied resources/icons
[INFO] Copied resources/loading
[INFO] Resolving your application dependencies (file:////path/to/my/sencha2/index.html)
[INFO] Found 53 dependencies. Concatenating all into '/dir/to/my/sencha2/build/production/app.js'
[INFO] Processed sdk/sencha-touch.js
[INFO] Minifying sdk/sencha-touch.js
[INFO] Processed app.js
[INFO] Minifying app.js
[INFO] Minifying resources/css/app.css
[INFO] Minified sdk/sencha-touch.js
[INFO] Minified app.js
[INFO] Minified resources/css/app.css
[INFO] Generated app.json
[INFO] Embedded microloader into index.html
[INFO] Generating checksum for appCache item: index.html
[INFO] Generated cache.manifest

So then I look in my new app.js that is in my build/production folder, and it has concatenated a bunch of sencha dependencies together, but the only file of mine that get concat'd and minified is my app.js, which is the only js file referenced in my app.json. That is why I was wondering if I have to manually put it in the app.json to get it to get concat'd and minified. None of the dependencies listed in my app.js require section get included in the builded app.js.

In summary, it doesn't give me the same behavior that I would expect, to build my app.js with all of my dependencies. Any thoughts would be nice.

like image 943
frosty Avatar asked May 09 '12 17:05

frosty


1 Answers

From my experience, I never had to modify the app.json. Everything that is mentioned in a 'Ext.requires' statement is automatically concatenated in the final (unique) js file by the sencha command.

If you still have problems, maybe you should give some more details about the files that are not correctly treated.

like image 193
borck Avatar answered Oct 11 '22 13:10

borck