-
Notifications
You must be signed in to change notification settings - Fork 162
Add an asset resolver override #917
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
Conversation
🦋 Changeset detectedLatest commit: 1dfa027 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
6b4c1e1
to
eb42c67
Compare
eb42c67
to
62a2bac
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.
I think we don't have a choice, but to check every single static assets in maybeGetAssetResult
@@ -170,6 +170,11 @@ export function getNextConfigHeaders( | |||
return requestHeaders; | |||
} | |||
|
|||
/** | |||
* TODO: This method currently only check for the first match. | |||
* It should check for all matches for `beforeFiles` and `afterFiles` rewrite |
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.
Is it for all or only for beforeFiles
? The docs talks about beforeFiles
only for that.
We need to look at how this is done in Next, but yeah definitely needs to be fixed
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.
It is a few lines appart but
Good to know: rewrites in beforeFiles do not check the filesystem/dynamic routes immediately after matching a source, they continue until all beforeFiles have been checked.
and
afterFiles rewrites are checked/applied, if one of these rewrites is matched we check dynamic routes/static files after each match
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.
Thanks for the review
I'll check the implementation and update the PR
@@ -170,6 +170,11 @@ export function getNextConfigHeaders( | |||
return requestHeaders; | |||
} | |||
|
|||
/** | |||
* TODO: This method currently only check for the first match. | |||
* It should check for all matches for `beforeFiles` and `afterFiles` rewrite |
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.
It is a few lines appart but
Good to know: rewrites in beforeFiles do not check the filesystem/dynamic routes immediately after matching a source, they continue until all beforeFiles have been checked.
and
afterFiles rewrites are checked/applied, if one of these rewrites is matched we check dynamic routes/static files after each match
@conico974 I think I have addressed all the feedback, could you please take another look? |
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.
LGTM Thanks!
Thanks for the review and feedback Nico! |
fixes #707
We plan to use that for the Cloudflare adapter when the worker runs in front of the assets (see )
The current override looks like:
Note I think
beforeFiles
andafterFiles
behavior do not match the Next doc - they all should be applied (vs only the first match in ON).