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
Post a Comment