Correct way to remove components / tasks from yoman / grunt?

I'm new to the Yeoman / Grunt / Bower stack, and I'm not sure if there is a way to remove a component / task from my project. I do not use CoffeeScript (which was packaged with the Yeoman generator), and it feels as if I should use the Grunt task or the Bower command to delete files / requirements / config / etc.

However, I can not find anything that would mention how to do this. Am I missing something or should I just remove components manually?

+7
bower gruntjs yeoman
source share
3 answers

I do not believe that there is an automated way to do this; with the exception of https://github.com/indieisaconcept/grunt-plugin , but for the old version (0.3.9) Grunt.

For Grunt tasks, just delete the line in devDependencies in package.json and then delete the corresponding section in grunt.initConfig and you will remove the plugin. Depending on what your Gruntfile looks like, you may need to delete the grunt.loadNpmTasks(<package>) section for the corresponding plugin. Then delete the directory in node_modules (or run npm uninstall <package> ). Simple really.

Bauer is even simpler; delete the corresponding line in bower.json and delete the directory in which it was installed (by default it is bower_components ).

Hope this helps. :)

+10
source share

You can delete the 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 delete. The --save flag tells npm to update the package.json file and also remove the corresponding package from the node_modules directory. (nb. if the task is specified in devDependencies - as it could be - you might need to use the --save-dev flag).

For Bower, the process is the same, only with bower uninstall instead of npm uninstall (as mentioned in Michael Okienko answer )

+4
source share

For Bower components:

 bower uninstall componentName --save 

This command will remove the component from bower.json and from bower_components .

+1
source share

All Articles