stealjs / steal-conditional

Conditional loading
https://stealjs.com/docs/steal-conditional.html
MIT License
6 stars 1 forks source link

Provide the ability to use some of @loader in the slim loader such as envs configuration #44

Closed matthewp closed 7 years ago

matthewp commented 7 years ago

Modules that use slim loader like:

var loader = require("@loader");

var url = loader.serviceBaseURL + "/api/todos";

Should not throw. I think the way to approach this is that steal-tools can provide a shim module for @loader. It can then attach the envs configuration to that loader object so that if it looks like:

"envs": {
  "window-production": {
    "serviceBaseURL": "http://example.com"
  }
}

The pseudo-code for the loader module would be:

module.exports = {
  "serviceBaseURL": "http://example.com"
}
matthewp commented 7 years ago

Issue moved to stealjs/steal-tools #721 via ZenHub