Skip to content

Commit

Permalink
feat(grunt): Add grunt cordova command to copy unminified assets into…
Browse files Browse the repository at this point in the history
… www/ and build cordova platform files
  • Loading branch information
diegonetto committed Mar 28, 2014
1 parent 8cab6fe commit 3161b9d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ The included Grunt build system provides sensible defaults to help optimize and
Running `grunt serve` enhances your workflow by allowing you to rapidly build Ionic apps without having to constantly re-run your platform simulator. Since we spin up a `connect` server with `watch` and `livereload` tasks, you can freely edit your CSS (or SCSS/SASS files if you chose to use Compass), HTML, and JavaScript files and changes will be quickly reflected in your browser.

### Building assets for Cordova
Once you're ready to test your application in a simulator, `grunt build` will concatenate, obfuscate, and minify your JavaScript, HTML, and CSS files and copy over the resulting assets into your app's `www/` directory so they are ready to be served by Cordova.
Once you're ready to test your application in a simulator or device, run `grunt cordova` to copy all of your `app/` assets into `www/` and build updated `platform/` files so they are ready to be emulated / run by Cordova.

To compress and optimize your application, run `grunt build`. It will concatenate, obfuscate, and minify your JavaScript, HTML, and CSS files and copy over the resulting assets into the `www/` directory so the compressed version can be used with Cordova.

### Cordova commands
To make our lives a bit simpler, the `cordova` library has been packaged as a part of this generator and delegated via Grunt tasks. To invoke Cordova, simply run the command you would normally have, but replace `cordova` with `grunt` and `spaces` with `:` (the way Grunt chains task arguments).
Expand Down
2 changes: 2 additions & 0 deletions templates/common/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,8 @@ module.exports = function (grunt) {
'cordova:build'
]);

grunt.registerTask('cordova', ['copy:all', 'cordova:build']);

grunt.registerTask('coverage', ['karma:continuous', 'connect:coverage:keepalive']);

grunt.registerTask('default', [
Expand Down

0 comments on commit 3161b9d

Please sign in to comment.