app/
resources/
app.js
app.json
sass/
Only the files above are committed, this decrease the repository size. The following procedure is used to make a new checkout of the project.
Requirements
- Sencha Cmd 5+
- ExtJS 5+
README.md
file.Generation
With Workspace
# Checkout hg clone <project_url> <checkout_dir> # Workspace Generation sencha -sdk <extjs_dir> generate workspace <workspace_dir> # Optional - ext directory symlink cd <workspace_dir> rm -rf ext ln -s <extjs_dir> ext # App generation cd <workspace_dir> sencha -sdk ext generate app <app_name> <app_dir> # Copy project files into generated project cd <app_dir> cp -r <checkout_dir>/* . # Remove checkout rm -rf <checkout_dir>
Without Workspace
# Checkout hg clone <project_url> <checkout_dir> # App generation sencha -sdk <extjs_dir> generate app <app_name> <app_dir> # Optional - ext directory symlink cd <app_dir> rm -rf ext ln -s <extjs_dir> ext # Copy project files into generated project cd <app_dir> cp -r <checkout_dir>/* . # Remove checkout rm -rf <checkout_dir>
Build
Now you can browse<app_dir>
and enter the commands:sencha app watch # development sencha app build # production
Ignored Files
For a new project.hgignore
will contain generated files^\.sencha$ ^sass/example$ ^sass/config.rb$ ^bootstrap.*$ ^build.xml$ // remove this line if you want to enable cache ^index.html*$
Extra Styles and Script
Every other css or js file is added toapp.json
in the sections css
e js
"css": [{ "path": "bootstrap.css", "bootstrap": true }, { "path": "resources/fontawesome.min.css" }],
Enable Cache
Sencha does not use cache by default. You can enable it by adding the following code inapp.json
It's recommended to add a task in theproduction": { "loader": { "cache": true } },
build.xml
that renames app.js
using its own md5<target name="-after-build"> <checksum file="${build.dir}/app.json" property="md5"/> <x-echo message="After Build: add md5 to app.js"/> <move file="${build.dir}/app.js" tofile="${build.dir}/app.${md5}.js"/> <replace token="app.js" value="app.${md5}.js" file="${build.dir}/app.json"/> <replace token="app.js" value="app.${md5}.js" file="${build.dir}/index.html"/> <x-echo message="app.js checksum ${md5}"/> </target>
No comments:
Post a Comment