generator-ionic
generator-ionic copied to clipboard
grunt clean doesn't work
"grunt clean" is supposed to clean the www directory, but it doesn't (although it seems to do quite a lot).
Adding this line at the end of Gruntfile.js fixes it for me:
grunt.loadNpmTasks('grunt-contrib-clean');
IIUC, this should be added to templates/common/_Gruntfile.js.
This issue causes some trouble. For example, "grunt serve:compress" uses the production environment (which is fine) but a subsequent "grunt serve" doesn't switch back to development.
Looks like cordova-cli 5.2 add a clean command which is loaded after the grunt-contrib-clean task.
https://github.com/apache/cordova-cli/commit/9fcc4e6ff92ce858735b407107c52d5c6c381295
It's kind of hacky but during the 'Register tasks for all Cordova commands' I just leave out the clean command