���Root Mod By V1rus_Alfa
User / IP
:
216.73.217.78
Host / Server
:
195.214.235.115 / npln.ir
System
:
Linux damavand.pws-dns.net 5.14.0-503.35.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Apr 4 05:23:43 EDT 2025 x86_64
Command
|
Upload
|
Mass Deface
|
Create
:
/
home2
/
cutunixc
/
.trash
/
node_modules.2
/
nuxi
/
dist
/
chunks
/
Viewing: preview.mjs
import { existsSync, promises } from 'node:fs'; import { dirname, relative } from 'node:path'; import { execa } from './index3.mjs'; import { d as defineCommand, c as consola, e as box, a as colors } from '../shared/nuxi.fefc5017.mjs'; import 'node:util'; import 'node:process'; import 'node:tty'; import { l as loadKit } from '../shared/nuxi.f76c700d.mjs'; import { s as sharedArgs, l as legacyRootDirArgs, r as resolve } from '../shared/nuxi.610c92ff.mjs'; import { s as setupDotenv } from '../shared/nuxi.16bb8ddb.mjs'; import 'node:url'; import 'node:child_process'; import 'node:string_decoder'; import '../shared/nuxi.6ce4ecc8.mjs'; import '../shared/nuxi.2155838d.mjs'; import 'child_process'; import 'path'; import 'fs'; import 'node:timers/promises'; import 'node:os'; import 'node:events'; import 'node:v8'; import 'node:stream'; import 'node:buffer'; import 'node:stream/promises'; import 'node:perf_hooks'; import '../shared/nuxi.eaa29140.mjs'; import './satisfies.mjs'; import '../shared/nuxi.de533993.mjs'; import '../shared/nuxi.cd7bfae6.mjs'; import 'node:module'; import '../shared/nuxi.deb0a220.mjs'; import 'node:assert'; import '../shared/nuxi.88c35b8d.mjs'; import 'crypto'; import 'module'; import 'perf_hooks'; import 'os'; import 'vm'; import 'url'; import 'assert'; import 'process'; import 'v8'; import 'util'; import 'tty'; import 'node:fs/promises'; import 'node:crypto'; import '../shared/nuxi.15c58622.mjs'; import '../shared/nuxi.b29fd623.mjs'; const preview = defineCommand({ meta: { name: "preview", description: "Launches Nitro server for local testing after `nuxi build`." }, args: { ...sharedArgs, ...legacyRootDirArgs, dotenv: { type: "string", description: "Path to .env file" } }, async run(ctx) { process.env.NODE_ENV = process.env.NODE_ENV || "production"; const cwd = resolve(ctx.args.cwd || ctx.args.rootDir || "."); const { loadNuxtConfig } = await loadKit(cwd); const config = await loadNuxtConfig({ cwd, overrides: ( /* ctx.options?.overrides || */ {} ) }); const resolvedOutputDir = resolve( config.srcDir || cwd, config.nitro.output?.dir || ".output", "nitro.json" ); const defaultOutput = resolve(cwd, ".output", "nitro.json"); const nitroJSONPaths = [resolvedOutputDir, defaultOutput]; const nitroJSONPath = nitroJSONPaths.find((p) => existsSync(p)); if (!nitroJSONPath) { consola.error( "Cannot find `nitro.json`. Did you run `nuxi build` first? Search path:\n", nitroJSONPaths ); process.exit(1); } const outputPath = dirname(nitroJSONPath); const nitroJSON = JSON.parse(await promises.readFile(nitroJSONPath, "utf-8")); if (!nitroJSON.commands.preview) { consola.error("Preview is not supported for this build."); process.exit(1); } const info = [ ["Node.js:", `v${process.versions.node}`], ["Nitro Preset:", nitroJSON.preset], ["Working directory:", relative(process.cwd(), outputPath)] ]; const _infoKeyLen = Math.max(...info.map(([label]) => label.length)); consola.log( box( [ "You are running Nuxt production build in preview mode.", `For production deployments, please directly use ${colors.cyan( nitroJSON.commands.preview )} command.`, "", ...info.map( ([label, value]) => `${label.padEnd(_infoKeyLen, " ")} ${colors.cyan(value)}` ) ].join("\n"), { title: colors.yellow("Preview Mode"), style: { borderColor: "yellow" } } ) ); const envExists = ctx.args.dotenv ? existsSync(resolve(cwd, ctx.args.dotenv)) : existsSync(cwd); if (envExists) { consola.info( "Loading `.env`. This will not be loaded when running the server in production." ); await setupDotenv({ cwd, fileName: ctx.args.dotenv }); } consola.info(`Starting preview command: \`${nitroJSON.commands.preview}\``); const [command, ...commandArgs] = nitroJSON.commands.preview.split(" "); consola.log(""); await execa(command, commandArgs, { stdio: "inherit", cwd: outputPath }); } }); export { preview as default };
Coded With 💗 by
0x6ick Mod By V1rus_Alfa