文件操作 - preset.mjs
返回文件管理
返回主菜单
删除本文件
文件: /var/www/OLD/node_modules/nitropack/dist/presets/_static/preset.mjs
编辑文件内容
import fsp from "node:fs/promises"; import { defineNitroPreset } from "nitropack/kit"; import { join } from "pathe"; const _static = defineNitroPreset( { static: true, output: { dir: "{{ rootDir }}/.output", publicDir: "{{ output.dir }}/public" }, prerender: { crawlLinks: true }, commands: { preview: "npx serve ./public" } }, { name: "static", static: true, url: import.meta.url } ); const githubPages = defineNitroPreset( { extends: "static", commands: { deploy: "npx gh-pages --dotfiles -d ./public" }, prerender: { routes: [ "/", // https://docs.github.com/en/pages/getting-started-with-github-pages/creating-a-custom-404-page-for-your-github-pages-site "/404.html" ] }, hooks: { async compiled(nitro) { await fsp.writeFile( join(nitro.options.output.publicDir, ".nojekyll"), "" ); } } }, { name: "github-pages", static: true, url: import.meta.url } ); const gitlabPages = defineNitroPreset( { extends: "static", prerender: { routes: [ "/", // https://docs.gitlab.com/ee/user/project/pages/introduction.html#custom-error-codes-pages "/404.html" ] } }, { name: "gitlab-pages", static: true, url: import.meta.url } ); export default [_static, githubPages, gitlabPages];
修改文件时间
将文件时间修改为当前时间的前一年
删除文件