-
Notifications
You must be signed in to change notification settings - Fork 280
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
Add example of (and fix) static asset proxy #254
Conversation
templates/demo-store/oxygen.ts
Outdated
* If you need to serve static assets from the same domain or from the root, | ||
* update the `shouldProxyAsset: (url: string) => boolean` function below | ||
* to return `true` when the url (pathname) matches your asset. | ||
*/ |
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.
Love the comment. Would be nice if we augmented the TS definition for the property so that this shows up when you're using shouldProxyAsset
as well, so that it becomes a little piece of documentation for it.
Stretch goal, though.
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.
Hey why the heck not, right?
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.
So beautiful
Adds a code comment explaining why the
shouldProxyAsset
function exists and how to use it.Also fixes asset proxying related to an errant
/build/
at the beginning of the asset prefix (which is actually a subfolder of/public
assets).