-
Notifications
You must be signed in to change notification settings - Fork 12k
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
Serve assets
files from ng test
#3628
Conversation
f8148bf
to
082e260
Compare
@filipesilva could you review? This LGTM but I want your eyes on it since you did the same for |
082e260
to
9ba5000
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logic, implementation and test seem solid. I left a question but it's mostly curiosity.
Thanks for making this happen @Meligy, cheers!
served: true, | ||
watched: true | ||
}); | ||
config.proxies['/' + proxyPath] = '/base/' + appConfig.root + '/' + proxyPath; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are proxies always needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm no karma expert and worked my way through trial and error really, but according to the docs and my tries, when you add a file to the files
array, it gets served from /base/src/path-to-file
only. The proxy adds another endpoint (like a URL rewrite) from /path-to-file
to /base/src/path-to-file
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@filipesilva I added a comment explaining why we need proxies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that makes sense to me. I remember a similar situation I ran into another project. Without the proxy, fetch would not work correctly.
9ba5000
to
6d302e4
Compare
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Closes #2803.
This pull request makes the files in the
assets
property ofangular-cli.json
get served from the web server runningng test
tests.It's very heavily inspired by @filipesilva's similar pull request #3543 that adds similar support for the
scripts
property (Thanks heaps Mr Filipe!).