-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Astro does not respect vite build
/serve
commands
#10262
Comments
It seems like changing the apply property does make a difference. I created this example based on yours. When |
It's working fine for me: https://stackblitz.com/edit/github-co8sdk. I think we need a proper repro to debug this. It's failing for you @nmattia likely because it's running Astro v0. |
Hello @nmattia. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with |
@bluwy thanks! I've tried to reproduce this and turns out it's a slightly different issue. Here is a repro: // astro.config.ts
import { defineConfig } from 'astro/config';
// https://astro.build/config
export default defineConfig({
vite: { /* some vite config, optional */ }
}); // vite.config.ts
import { defineConfig } from "vite";
export default defineConfig({
plugins: [
{
name: 'a',
apply: 'serve',
buildStart() {
console.log('serve');
},
},
]
}) If you run This is even more confusing in my case (code not shared) where the |
Thanks! I can repro that now too. I'm not sure why we didn't do it before, but the code you linked should be passing |
No problem. The changes seem to be good |
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
When astro loads the vite config it does not set the correct
command
from vite'sUserConfig
.For instance, running
astro build
with a plugin that hasapply: "serve"
will load the plugin nonetheless.will apply
somePlugin
. Same goes withcommand
is read and used instead ofapply
.What's the expected result?
Astro should set the correct
command
when loading the vite config.NOTE: I could not add a minimal reproducible example because the playground seems broken (errors out on the default example):
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-ngr3mk
Participation
The text was updated successfully, but these errors were encountered: