Create an Ionic project with Grunt using Yeoman
First, install Yeoman and generator-hionic using npm (we assume you have pre-installed node.js).
npm install -g yo
npm install -g generator-hionic
- Choose a directory and
cd
into it
$ mkdir <my-app-name> && cd $_
- Run
yo hionic
command and you can also use some options
yo hionic [appName] --appId "com.company.myapp" --appModuleName "myapp"
-
When finish yo installation run
grunt serve
to start app. -
Build App, run
grunt build
to build ios (Android not support right now). You also can rungrunt build:production
to build production version app. However, you must set production constants in Gruntfile at first.
Project structure is following:
├── app/
│ ├── images/ - Project images
│ ├── lib/ - Libraries managed by Bower
│ ├── scripts/ - Custom AngularJS Scripts
│ ├── scss/ - Sass Stylesheets
│ ├── views/ - HTML views
│ ├── index.html - Main Ionic app entry point
├── hooks/ - Cordova lifecycle hooks
├── test/ - Unit tests
│ ├── spec/
├── .gitignore - Git ignore file
├── .bowerrc - Bower rc file
├── bower.json - Lists front-end dependencies
├── Gruntfile.js - Configuration of all Grunt tasks
├── package.json - Dev dependencies and required Cordova plugins
├── config.xml - Global Cordova configuration
- Yeoman has a heart of gold.
- Yeoman is a person with feelings and opinions, but is very easy to work with.
- Yeoman can be too opinionated at times but is easily convinced not to be.
- Feel free to learn more about Yeoman.
MIT © Martin_nett