OS-independent grunt script command in NPM package.json
I've found the solution in creating a grunt.bat
file that just calls grunt.cmd
:
@grunt.cmd %*
Therefore, on Windows, just invoking grunt
triggers the batch file since it gets higher priority than Windows Scripting Host's picking up of grunt.js
. On Linux, the regular grunt
binary gets picked up. This works cross-platform for me now.