fix: pass flags to dev (#5840)
* fix: pass flags to dev * add changeset * Update .changeset/eleven-bulldogs-provide.md Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
This commit is contained in:
parent
c4b0cb8bf2
commit
cf2de5422c
3 changed files with 9 additions and 1 deletions
5
.changeset/eleven-bulldogs-provide.md
Normal file
5
.changeset/eleven-bulldogs-provide.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Persist CLI flags when restarting the dev server
|
|
@ -189,6 +189,7 @@ async function runCommand(cmd: string, flags: yargs.Arguments) {
|
|||
await devServer(settings, {
|
||||
configFlag,
|
||||
configFlagPath,
|
||||
flags,
|
||||
logging,
|
||||
telemetry,
|
||||
handleConfigError(e) {
|
||||
|
|
|
@ -3,6 +3,7 @@ import type http from 'http';
|
|||
import type { AddressInfo } from 'net';
|
||||
import { performance } from 'perf_hooks';
|
||||
import * as vite from 'vite';
|
||||
import yargs from 'yargs-parser';
|
||||
import type { AstroSettings } from '../../@types/astro';
|
||||
import { info, LogOptions, warn } from '../logger/core.js';
|
||||
import * as msg from '../messages.js';
|
||||
|
@ -12,6 +13,7 @@ import { createContainerWithAutomaticRestart } from './restart.js';
|
|||
export interface DevOptions {
|
||||
configFlag: string | undefined;
|
||||
configFlagPath: string | undefined;
|
||||
flags: yargs.Arguments | undefined;
|
||||
logging: LogOptions;
|
||||
telemetry: AstroTelemetry;
|
||||
handleConfigError: (error: Error) => void;
|
||||
|
@ -35,7 +37,7 @@ export default async function dev(
|
|||
|
||||
// Create a container which sets up the Vite server.
|
||||
const restart = await createContainerWithAutomaticRestart({
|
||||
flags: {},
|
||||
flags: options.flags ?? {},
|
||||
handleConfigError: options.handleConfigError,
|
||||
// eslint-disable-next-line no-console
|
||||
beforeRestart: () => console.clear(),
|
||||
|
|
Loading…
Reference in a new issue