Back-end developer is asking about front-end.
I've got two functions which are totally different. One of them is for a production, another - for a local development. For example, when I'm in a development mode, the situation is as follows:
/*
function f() {
// production logic
}
*/
function f() {
// development logic
}
As you may see, I always comment one of the functions. Before making a build for a production I should remove comments for the production function, and add them to the development one.
I really don't want to make the if
statement where I'll check out some variable (if the value equals "DEV"
then ... else ...). The functions are too large and contain many non-contiguous parts.
I googled a lot, but nothing has found. Is something like? Something like profiles with their variables that can be integrated into JS files? Or marking a function with a comment which excludes/includes a function from/in a build as that's possible with HTML.
The project is being gathered by Grunt.