Skip to content

Instantly share code, notes, and snippets.

@goshacmd
Created July 25, 2012 20:17
Show Gist options
  • Save goshacmd/3178375 to your computer and use it in GitHub Desktop.
Save goshacmd/3178375 to your computer and use it in GitHub Desktop.
Brunch config compiler proposal
# When compiled with `NODE_ENV=production PUSHER_APP_KEY=123abc API_ENDPOINT_HOST=api.app.com brunch build`
# the following is produced and included into build.
config = {api: {}}
config.env = "production"
config.pusher_app_key = "123abc"
config.api.endpoint = "api.app.com"
module.exports = config
# ECO is template processed by node.js first, then is put as app/config.coffee and included into built app.
config = {api: {}}
config.env = "<%= process.env.NODE_ENV or 'development' %>"
config.pusher_app_key = "<%= process.env.PUSHER_APP_KEY %>"
config.api.endpoint = "<%= process.env.API_ENDPOINT_HOST or 'api.app.dev' %>"
module.exports = config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment