UNPKG

ap-ssg

Version:

A fast, modular, SEO-optimized static site generator that minifies CSS, JS, and HTML for improved performance. It also supports JSON-LD, sitemap generation, and more, making it ideal for production-ready websites.

26 lines (20 loc) 808 B
const path = require("node:path"); const fs = require("fs-extra"); const apssgConfigObject = require("../defaults/apssgConfigObject"); const { getConfigFilePath } = require("../configs/paths"); async function generateConfig() { const configFilePath = getConfigFilePath(); const fileExists = await fs.pathExists(configFilePath); if (fileExists) { console.log("⚠️ apssg.config.js already exists. Skipping creation."); return; } const configContent = `module.exports = ${apssgConfigObject};\n`; try { await fs.outputFile(configFilePath, configContent); return "✅ apssg.config.js has been created successfully."; } catch (error) { console.error("❌ Failed to create apssg.config.js:", error.message); } } module.exports = generateConfig;