Skip to content

Commit

Permalink
fix(check): Dynamically import check command (#6717)
Browse files Browse the repository at this point in the history
  • Loading branch information
Princesseuh authored Mar 31, 2023
1 parent 9cc7329 commit c2d4ae1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/eight-stingrays-pull.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Dynamically import check command to improve startup speed and prevent Astro from crashing due to language-server stuff
3 changes: 2 additions & 1 deletion packages/astro/src/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit c2d4ae1

Please sign in to comment.