-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
feat: fix the use of vite.base in Astro Dev Server #13003
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 0930a6c The changes in this PR will be included in the next version bump. 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 |
CodSpeed Performance ReportMerging #13003 will not alter performanceComparing Summary
|
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.
This PR is blocked because it contains a major
changeset. A reviewer will merge this at the next release if approved.
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 your contribution. I've left a few comments, but before you do more we need a much more detailed description in the PR of what exactly it is trying to do. need more info to see if this is something that needs doing. If this is just something for nginx then it's not something we're likely to add - it needs to show what problem it is solving, and how. It will also need tests, proabably ones that fail before your PR is added. I
@@ -241,6 +241,7 @@ type AstroContainerConstructor = { | |||
streaming?: boolean; | |||
renderers?: SSRLoadedRenderer[]; | |||
manifest?: AstroContainerManifest; | |||
config?: any; |
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 already have this as viteConfig
below. We also can't have any
.changeset/fresh-badgers-itch.md
Outdated
'astro': patch | ||
--- | ||
|
||
nginx proxy pass dev mode |
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.
This needs a full description of what this PR does, phrased as if it's prefixed with "This PR..."
The problem solved by this PR is that after setting the base, when
It still starts with/node_modules. The expectation should start with the value of base,
I found that modifying the base of the root node of astro.config.mjs does not work. I need to set vite.base so that it can be parsed correctly.
For example: When using 127.0.0.1 or localhost, the generated resources can be accessed normally even if the address is incorrect. But when I resolve a domain name locally C:\Windows\System32\drivers\etc\hosts Then when I use |
Thank you @chaegumi for your comment. Please update the title and description of the PR to better reflect what you're trying to solve. Also, add some tests |
Changes
Resolve this issue
#7520
The problem solved by this PR is that after setting the base, when
pnpm run dev
, the src address of the generated script type="module" tag is incorrect,It still starts with/node_modules.
The expectation should start with the value of base,
I found that modifying the base of the root node of astro.config.mjs does not work. I need to set vite.base so that it can be parsed correctly.
For example:
When using 127.0.0.1 or localhost, the generated resources can be accessed normally even if the address is incorrect.
But when I resolve a domain name locally
C:\Windows\System32\drivers\etc\hosts
127.0.0.1 example.local
Then when I use
example.local/theme141
to access it, there will be a path error. Not setting the root base, only setting vite.base, and then cooperating with my modifications, can make the program run perfectlyTesting
Docs