elearning/Frontend-Learner/node_modules/@nuxt/cli/dist/cleanup-BhQbCstD.mjs
2026-01-13 10:48:02 +07:00

32 lines
No EOL
941 B
JavaScript

import { a as legacyRootDirArgs, t as cwdArgs } from "./_shared-BCYCnX0T.mjs";
import { n as logger } from "./logger-B4ge7MhP.mjs";
import { t as loadKit } from "./kit-B3S8uoS_.mjs";
import "./fs-CQH7NJn6.mjs";
import { t as cleanupNuxtDirs } from "./nuxt-B1NSR4xh.mjs";
import { defineCommand } from "citty";
import { resolve } from "pathe";
//#region ../nuxi/src/commands/cleanup.ts
var cleanup_default = defineCommand({
meta: {
name: "cleanup",
description: "Clean up generated Nuxt files and caches"
},
args: {
...cwdArgs,
...legacyRootDirArgs
},
async run(ctx) {
const cwd = resolve(ctx.args.cwd || ctx.args.rootDir);
const { loadNuxtConfig } = await loadKit(cwd);
const nuxtOptions = await loadNuxtConfig({
cwd,
overrides: { dev: true }
});
await cleanupNuxtDirs(nuxtOptions.rootDir, nuxtOptions.buildDir);
logger.success("Cleanup complete!");
}
});
//#endregion
export { cleanup_default as default };