feature request: load environment config
Right now any environment-specific config under ./config/env is not being loaded.
There's a few additional things that sails will attempt to load - including local.js, env/{env}/*.js, and env/{env}.js -- this logic is not coming through with the loader.
The code in sails core that handles this is here: https://github.com/balderdashy/sails/blob/master/lib/hooks/moduleloader/index.js#L223-L236
As best as I can determine, buildDictionary isn't actually asynchronous so it should be a matter of of updating ./libs/config to include the same logic as sails core.
PR incoming.
Great idea to load more config options but as I can think now, load the config in async will break this loader, cause we want to load config before any hook initialisations, if you make it async sails can launch some hook initialisation before config is load... @leeroybrun did you make some test to be sure it's ok about this ?
My fault, I think you are right @jaumard. I've not thinked about the sync/async problem with config.
We need to do more tests on this...
There is definitely a race condition here... I didn't realize that async.auto wraps task completions in setImmediate.
Fortunately, sails-build-dictionary is synchronous, so it shouldn't be too hard to rework this to be completely synchronous.... I'll send a new PR with this.