Is it possible to use debugOnly from outside of the packages


#1

Hi, I need to generate a fake data for local development but this code should not be able to run on produciton

if (isDebug & isEmpty...) {

}

#2

You can get the absoluteURL and see if it starts with “http://localhost”… anybody want to see that as a package?


#3

Pretty sure that’s not how it works. debugOnly is for managing the importing of packages. @msavin offers a better solution… detect the url with Meteor.absoluteUrl and whether it’s empty with MyCollection.find().count().


#4

Thanks for your answer, I think it should be a part of meteor core.
Something like: Meteor.environment = (production | development | testing)


#5

Agree - was surprised when Meteor didn’t have this built in


#6

Ok, what should I do next? Contact with someone from meteor core-team? Or create issue directly on github?