fix(check): Dynamically import check command (#6717)

This commit is contained in:
Erika 2023-03-31 15:18:37 +02:00 committed by GitHub
parent 9cc7329759
commit c2d4ae1cbe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Dynamically import check command to improve startup speed and prevent Astro from crashing due to language-server stuff

View file

@ -18,7 +18,6 @@ import { enableVerboseLogging, nodeLogDestination } from '../core/logger/node.js
import { formatConfigErrorMessage, formatErrorMessage, printHelp } from '../core/messages.js';
import * as event from '../events/index.js';
import { eventConfigError, eventError, telemetry } from '../events/index.js';
import { check } from './check/index.js';
import { openInBrowser } from './open.js';
type Arguments = yargs.Arguments;
@ -228,6 +227,8 @@ async function runCommand(cmd: string, flags: yargs.Arguments) {
}
case 'check': {
const { check } = await import('./check/index.js');
// We create a server to start doing our operations
const checkServer = await check(settings, { flags, logging });
if (checkServer) {