Reputation: 4829
I have a sample grunt plugin
/tasks
sample.js
config.file
Gruntfile.js
package.json
I want to get the path to the config.file inside the sample.js. At first, I did it like this
path.resolve('tasks/config.file')
It was OK until the plugin had been installed. Path to the config.file changed to '~/some_project/node_modules/sample_plugin/tasks/config.file' but path.resolve
returned '~/some_project/tasks/config.file'.
How can I get proper path to the config.file?
Upvotes: 4
Views: 2378