[Sencha Cmd] sencha app build
Hi there,
recently I adapted my app to use Sencha Cmd.
As a result *sencha app build* executes successfully, but when I launch my code I get following error:
| Error evaluating http://localhost/myapp/app.js with message: ReferenceError: GlobalVars is not defined |
localhost:80 |
| G |
localhost:80 |
| c |
localhost:81 |
| b |
localhost:81 |
| (anonymous function) |
localhost:84 |
| E.b |
localhost:79 |
| h.onreadystatechange |
localhost:78 |
Partial definition of GlobalVars:
Code:
Ext.define 'MyApp.utils.GlobalVars',
extend: 'Ext.mixin.Observable'
alternateClassName: 'GlobalVars'
singleton: true
config:
# ...
Moreover if I get rid of 'alternateClassName' and update codes accordingly (GlobalVars => MyApp.utils.GlobalVars) I get following error instead:
| Error evaluating http://localhost/myapp/app.js with message: TypeError: Cannot read property 'GlobalVars' of undefined |
localhost:80 |
| G |
localhost:80 |
Application works fine even with microloader if I don't deploy built (by Sencha Cmd utility) production code, but I didn't adapt to Sencha Cmd without reason. I want my codes to be deployed concatenated into one, minified (app.js) source file.
Any help appreciated.
Best way to adapt an app to cmd
Hi, I once had to adapt all my apps to use cmd.
Here is how I did it:
Rename my app myApp into myApp-old
Run in terminal: sencha generate app myApp ../myApp
Then I copied the app dir content of myApp-old into myApp. (Don't include the index.html and the directories .sencha and touch)
Success