2
I have a very bad problem in my web projects, I don’t work with environments, I wanted my application to have different configuration types according to the environment, for example: in the DEV environment my application accesses one server and in the PROD environment it accesses another. For that I would have to have a Grunt task that changes variables in my script when deploying, someone knows how to do this ?
This is my Gruntfile
Utilise environment variables does not solve your problem? You can access them using
process.env.VARIAVEL.– gabrielhof
No, it’s my script settings that will run in the browser.
– Fábio Lemos Elizandro
Ah, of course. Well, anyway, there’s no way to pass the settings to two files
.jsseparated (config-dev.jsandconfig-prod.js, for example) and define when to use each in theGruntfile.js?– gabrielhof
Could post your
Gruntfile.js?– gabrielhof
@gabrielhof put the link in my question
– Fábio Lemos Elizandro
One last question, do you want to access these servers via AJAX? If so, you intend to use JSONP for this?
– gabrielhof
It will be an HTML5 application consuming a PHP Webservice. And I don’t use JSONP only JSON
– Fábio Lemos Elizandro
Let’s go continue this discussão in chat.
– gabrielhof