2

In Angular the “webpack_public_path” or “webpack_require.p” can be defined for a project in a couple of ways:

  • Set the deployUrl in the .angular-cli.json file
  • Add –deployUrl “some/path” to the “ng build” command line

However, I need to be able to set this value at runtime so it comes from my assets/config.json file when the applicaiton starts. I’m thinking of something like the following, perhaps defined in my main.ts file, but nothing I have tried works:

__webpack_require__.p=window.config['deployUrl'];

Could someone tell me how to do this, any help would be greatly appreciated! Thanks!