MauF
MauF

Reputation: 451

Grunt: what is the purpose of cwd?

I know cwd stands for "current working directory", but what I don't understand is why is has to be included in the gruntfile.js.

Won't the script run always in the current working directory? Why would you need to change or specify another one?

Upvotes: 9

Views: 9090

Answers (1)

sonali
sonali

Reputation: 758

grunt.js resides in the root of our project.

cwd is the path where grunt looks for the files matching the pattern in src and performs operations on. It can be an img folder in the current project root or a script folder in the current project root.

In other words, cwd is the parent folder of src files. It might not be the root folder of the root of the current project but a child of it.

Hope this helps answer your question.

Upvotes: 18

Related Questions