next-dev
Version:
Tentu, berikut adalah markdown yang telah diperbaiki:
19 lines (18 loc) • 728 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const fs_1 = __importDefault(require("fs"));
const path_1 = __importDefault(require("path"));
function isNextJsRootDir() {
const dir = process.cwd();
const configFiles = ['next.config.js', 'next.config.mjs', 'next.config.cjs'];
const configExists = configFiles.some(name => fs_1.default.existsSync(path_1.default.join(dir, name)));
if (configExists) {
return true;
}
console.log("please run in next project root".yellow);
process.exit(1);
}
exports.default = isNextJsRootDir;