1

I have a application built with aurelia and bundled with webpacks. I have a variables in a typescript file. When i do a producation build, I just want to change those variables when I deploy at various servers. Example apiRoot= http://10.10.0.1/RESTSERVICES/---> when deployed at one server when deployed at another server I what apiRoot do be different. But I don't want to build the code multiple times to deploy at various locations.

For this reason I'm looking a run time config file for aurelia application built with webpacks. Thanks in Advance

1 Answers1

0

I think what you are asking is potentially similar to the Q here Aureliajs Waiting For Data on App Constructor.

In that question, I gave suggestion on how to do it in different ways, which is copy-pasted below:

Aurelia provides many ways to handle asynchronous flow. If your custom element is a routed component, then you can leverage activate lifecycle to return a promise and initialize the http service asynchronously.

Otherwise, you can use CompositionTransaction to halt the process further, before you are done with initialization. You can see a preliminary example at https://tungphamblog.wordpress.com/2016/08/15/aurelia-customelement-async/

You can also leverage async nature of configure function in bootstrapping an Aurelia application to do initialization there:

export function configure(aurelia) {
  ...
  await aurelia.container.get(HttpServiceInitializer).initialize();
}
bigopon
  • 1,924
  • 2
  • 14
  • 23