Skip to content Skip to sidebar Skip to footer

How Do I Set The Deployurl At Runtime In Angular

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

Solution 1:

After some further investigation it turns out that the answer posted for the question "In Webpack, how do I set the public path dynamically?" did work. When I originally tried this I couldn't get it working, but after trying again I was successful.

The only difference was that I did not create a globals.d.ts file to add the declare statement, I just added the following lines into my main.ts file:

declarevar  __webpack_public_path__:string;
__webpack_public_path__= 'public/path/location';

I'm not sure if this is best practice or not...

Post a Comment for "How Do I Set The Deployurl At Runtime In Angular"