I'm new to the Yeoman/Grunt/Bower stack and I'm unsure if there is a proper way to remove a component/task from my project. I don't use CoffeeScript (which was packaged with the Yeoman generator) and it feels like I should be using a Grunt task or Bower command to remove the files/requirements/config/etc.
However, I can't find anything mentioning how to do this. Am I missing something or should I just remove the components by hand?
I don't believe there is an automated way of doing this; save for https://github.com/indieisaconcept/grunt-plugin but that's for the old release (0.3.9) of Grunt.
For Grunt tasks, simply remove the line in devDependencies
in package.json
and then remove the relevant section in grunt.initConfig
and you will have uninstalled the plugin. Depending on how your Gruntfile looks, you may have to remove the grunt.loadNpmTasks(<package>)
section for the relevant plugin. Then remove the directory in node_modules
(or run npm uninstall <package>
). Simple really.
Bower is even easier; remove the relevant line in bower.json
and delete the directory it was installed (the default is bower_components
).
Hope this helps. :)
You can remove a Grunt task by running the following command:
npm uninstall grunt-task-name --save
...where grunt-task-name
is the name of the task you want to remove. The --save
flag tells npm to update your package.json file as well as deleting the relevant package from your node_modules directory. (nb. if the task is listed under devDependencies
- as it might well be - you might need to use the --save-dev
flag instead).
For Bower the process is the same, only with bower uninstall
instead of npm uninstall
(as mentioned in Michael Onikienko's answer)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With