Use ionic serve to start a local development server for app dev and testing. This is useful for both desktop browser testing, and to test within a device browser which is connected to the same network. Additionally, this command starts LiveReload which is used to monitor changes in the file system. As soon
as you save a file the browser is refreshed automatically. Take a look at the Sass docs if you would also like to have ionic serve watch the project’s Sass files.
$ ionic serve [options]
LiveReload
By default, LiveReload will watch for changes in your www/ directory, excluding www/lib/. To change this, you can specify a watchPatterns property in the ionic.project file located in your project root to watch (or not watch) for specific changes.
{
"name": "myApp",
"app_id": "",
"watchPatterns": [
"www/js/*",
"!www/css/**/*"
]
}
For a reference on glob pattern syntax, check out globbing patterns on the Grunt website.
Note:
$ ionic setup sass
will add a watchPatterns propery with the default values to your ionic.project file that you can then edit, in addition to the gulpStartupTasks property as described in the Sass documentation.