aboutsummaryrefslogtreecommitdiff
path: root/packages/astro/src/reload.ts
blob: 3d635cd517fab8c800c98bea5ffbe232121609e6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import type { LogOptions } from './logger';
import { clearCache } from 'snowpack';
import { defaultLogDestination, defaultLogLevel, info } from './logger.js';

const logging: LogOptions = {
  level: defaultLogLevel,
  dest: defaultLogDestination,
};

export async function reload() {
  try {
    info(logging, 'reload', `Clearing the cache...`);
    await clearCache();
    return 0;
  } catch {
    return 1;
  }
}