Reputation: 288
How to load your new grunt-plugin module to your project.
example of dir structure:
|-- abc-project
| |-- ...
| |-- app.js
| |-- Gruntfile.js --> `grunt.loadNpmTasks('my-grunt-plugin');`
| \-- package.json
|
\-- my-grunt-plugin
|-- grunt-tasks
| |-- task-a.js --> `grunt.registerTask('task-a', 'running task a', function() { ... });`
| \-- task-b.js
\-- ...
npm link
command inside my-grunt-plugin
dir. npm link my-grunt-plugin
command inside abc-project
dir. grunt task-a
command, it will log Local Npm module "my-grunt-plugin" not found. Is it installed?
Upvotes: 2
Views: 416
Reputation: 288
The issue in this case is the task dir name in the my-grunt-plugin
.
You need to make sure that the name of task dir is always tasks
NOT grunt-tasks
.
Upvotes: 0