linemanjs / lineman

Lineman helps you build fat-client JavaScript apps. It produces happiness by building assets, mocking servers, running specs on every file change
MIT License
1.18k stars 83 forks source link

Environment specific config #326

Closed trobrock closed 9 years ago

trobrock commented 9 years ago

I am trying to figure out the best way to get a small set of JS accessible config variables to be set based on lineman being in dev or dist mode. Is there a decent way of doing this? Even if I could have two copies of the file and one gets used in dev and the other in dist would work for us.

searls commented 9 years ago

What I do for this is set a variable on each of the pages.dev.context and pages.dist.context to indicate what my LINEMAN_ENV is. Then I drop that in as a global in my pages/index.us

So many projects need this that we should just make it built in.

searls commented 9 years ago

As an example see the pages config here so I can set a CDN in prod but not Dev: https://github.com/linemanjs/lineman-docs/blob/master/config/application.coffee

trobrock commented 9 years ago

@searls Thanks, this simplified the solution we came up with a lot