var
var

Reputation: 21

Can Gruntfile.js file be renamed?

I'm using grunt now which I'm very thankful of because it is very convenient. However my boss said the he wants to rename the Gruntfile.js file because it is confusing. He wants to rename it to Start.js. So is it possible to rename it? Is there a way to rename it?

Upvotes: 1

Views: 83

Answers (2)

var
var

Reputation: 21

Actually there is a way. For future references please use this method: http://gruntjs.com/using-the-cli#gruntfile

"Specify an alternate Gruntfile. By default, grunt looks in the current or parent directories for the nearest Gruntfile.js or Gruntfile.coffee file."

So, I renamed my file as Start.js. I'll call it in the cli as grunt --gruntfile=Start.js That's it.

Upvotes: 1

Jack_Hu
Jack_Hu

Reputation: 1379

There isn't a good way as far as I'm aware.

The issue you'll have is that npm, and other package managers will overwrite it on update even if you hacked its core to work properly with a different filename.

You might be able to piece something together using symbolic links, and hiding the original, but that's dependent on your OS, and is really a different question.

Seriously, save yourself a massive headache and just tell them it can't be done.

Upvotes: 1

Related Questions