Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix(nextjs): Support custom
distDir
values in defaultRewriteFrames
integration #4017New 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
fix(nextjs): Support custom
distDir
values in defaultRewriteFrames
integration #4017Changes from all commits
6611e0a
f3bce8c
ef5a0bd
671bcc9
8a4c43e
ea1368b
c321ade
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Not related to the PR, but if we set proper names we don't need this comment. What do you think of this suggestion? Do you have other alternatives?
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.
Hmmm - interesting. I'd probably go for
mightContainUserCode
, but it's not a bad idea. I'm not going to do it in this PR, but I need to make a separate one adding_error
to the filter, so I can do it there.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.
IMO this isn't precise enough, since:
From Next.js docs.
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.
You mean your build directory could be
< projAbsPath >/stuff/things/build
? You'd still need to setdistDir: "stuff/things/build"
, so it would still work. Or am I misunderstanding your concern?FWIW, the reason for doing it there, as
cwd()
, rather than including the project directory in the globally-stored value is that while it does run from< projAbsPath >/stuff/things/build
on a normal deployment, when it runs on AWS it's/var/task/stuff/things/build
.Also, if it helps, you can see in the server constructor that it uses
"."
as the project directory and then sticks thedistDir
at that level of the file structure.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.
My comment was about the comment, not the code. IMO, if we're adding comments they should be as specific as possible, since it may create confusion over existing code. Instead of "always puts the build directory at the project root level", we can say "the build directory is a subdirectory of the project root". The difference is that the first sentence doesn't say anything about the restrictions of the value of what users set; while the second one does, and covers both the nextjs' and users' values (the only case in which this is not true is when users have
distDir
configured incorrectly, and this not happening is IMO an assumption we can make here).Not blocking with this, so your call.