Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
ng build --deploy-url does not work on scripts added through lazy loading or Service Workers #13894
If I run this command:
ng build --deploy-url=https://cdn.acme.com/assets/
Then I expect my all of the scripts that are added dynamically to use that deploy URL, like this:
<script charset="utf-8" src="https://cdn.acme.com/assets/lazy-loaded-module.213123.js"></script>
I get this instead:
<script charset="utf-8" src="/assets/lazy-loaded-module.213123.js"></script>
I have a bundling process in my backend server on startup that will upload all assets to CloudFront global CDN, and since I can't seem to hook into the URLs for lazy-loaded modules, I'm not able to upload the to the CDN in production and as such my scripts are loaded from file server in the backend API, which I no longer want to support as I want to use CloudFront for serving all static assets.
I also have same issue with the Service Worker files.