Skip to content

ng build --deploy-url does not work on scripts added through lazy loading or Service Workers #13894

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
lansana opened this issue Mar 13, 2019 · 2 comments

Comments

@lansana
Copy link

lansana commented Mar 13, 2019

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.

Please advise.

@alan-agius4
Copy link
Collaborator

Duplicate of #12322

@alan-agius4 alan-agius4 marked this as a duplicate of #12322 Mar 13, 2019
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants