Compare commits

..

No commits in common. "385bcb16d8ee70ffd53433c1427cc669490f0ba1" and "b09560a4e54ebf76b0114a2051037d278ba399ee" have entirely different histories.

2 changed files with 3 additions and 6 deletions

View File

@ -40,8 +40,5 @@ export default defineConfig({
distPath: {
root: 'dist/web',
},
copy: process.env.NODE_ENV === 'development' ? [
{ from: './content', to: 'content' }
] : [],
},
});

View File

@ -223,7 +223,7 @@ export function createContentServer(
watcher
.on("add", (path) => {
if (path.endsWith(".md") || path.endsWith(".csv") || path.endsWith(".yarn")) {
if (path.endsWith(".md")) {
try {
const content = readFileSync(path, "utf-8");
const relPath = "/" + relative(contentDir, path).split(sep).join("/");
@ -235,7 +235,7 @@ export function createContentServer(
}
})
.on("change", (path) => {
if (path.endsWith(".md") || path.endsWith(".csv") || path.endsWith(".yarn")) {
if (path.endsWith(".md")) {
try {
const content = readFileSync(path, "utf-8");
const relPath = "/" + relative(contentDir, path).split(sep).join("/");
@ -247,7 +247,7 @@ export function createContentServer(
}
})
.on("unlink", (path) => {
if (path.endsWith(".md") || path.endsWith(".csv") || path.endsWith(".yarn")) {
if (path.endsWith(".md")) {
const relPath = "/" + relative(contentDir, path).split(sep).join("/");
delete contentIndex[relPath];
console.log(`[删除] ${relPath}`);