javascript - Gruntjs read from external json file -


i attempting read in external json file , use in custom task:

inside initconfig

grunt.initconfig({   env: grunt.file.readjson("path"),   ...   ..   . });  // registering task grunt.registertask('namehere', 'descriptionhere', function () {    // how @ "env"     "<%= env.environment %>" // doesnt work gives me string literal "<%= environmentvars.environment %>" }); 

you're use grunt.config.get("env") or grunt.config("env") purpose.

more info: http://gruntjs.com/api/grunt.config#grunt.config.get (thanks @mike fielden)


Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -