-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
The base
property would be changed
#4381
Comments
const config = {
base: 'http://localhost:8000/',
plugins: [
{
name: 'test',
config(config) {
console.log(config.base); // => 'http://localhost:8000/',
},
configResolved(config) {
console.log(config.base); // => '/'
},
}
]
// ...
}
vite/packages/vite/src/node/config.ts Lines 342 to 343 in eef51cb
Then, overwrite base .vite/packages/vite/src/node/config.ts Lines 408 to 415 in eef51cb
It's hard to decide whether it is a bug? It does look confusing. I personally don't consider it a bug and it should be mentioned in docs to avoid becoming an undefined behavior or split |
This looks like a dev-only behaviour, but fixing would cause a breaking change given how long this behaviour had existed, and I'm not sure if it's correct either. My understanding is that it's Re |
Some slightly related conversations: #4274 (comment) |
Don't want to increase the noise here, so I edited my previous comment. In most cases, users that want to provide a full origin to |
We also discussed in the last meeting that this is intentional. Vite will resolve the |
Describe the bug
The
base
property would be changed when it gotbase
onconfigResolved
hook.Reproduction
it prints
'/'
not'http://localhost:8000/'
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: