diff --git a/nino.koei.js b/nino.koei.js index d11c284fc..0b8637ac1 100644 --- a/nino.koei.js +++ b/nino.koei.js @@ -39,22 +39,14 @@ const getCopyPluginProps = mappings => { const src = `src/assets/${category}/${id}.${ext}`; const dist = `dist/${category}/${id}/${id}.${ext}`; const distEditor = `dist/${category}-editor/${id}/${id}.${ext}`; - if (category === 'mapping') { - documentFiles.push({ - from: path.join(__dirname, src), - to: path.join(__dirname, dist), - }); - } - if (category === 'markdown') { - documentFiles.push({ - from: path.join(__dirname, src), - to: path.join(__dirname, dist), - }); - documentFiles.push({ - from: path.join(__dirname, src), - to: path.join(__dirname, distEditor), - }); - } + documentFiles.push({ + from: path.join(__dirname, src), + to: path.join(__dirname, dist), + }); + documentFiles.push({ + from: path.join(__dirname, src), + to: path.join(__dirname, distEditor), + }); }); return [...assetsFiles, ...exhentaiFiles, ...documentFiles]; diff --git a/server/utils/document.ts b/server/utils/document.ts index af7f7fd96..dcfbde2f3 100644 --- a/server/utils/document.ts +++ b/server/utils/document.ts @@ -70,9 +70,11 @@ const getWriteMappingPaths = ( return [`src/assets/mapping.json`, `dist/assets/mapping.json`]; } checkCategory(category); + const ext = category === 'mapping' ? 'json' : 'md'; return [ - `src/assets/${category}/${id}.${category === 'mapping' ? 'json' : 'md'}`, - `dist/assets/${category}/${id}.${category === 'mapping' ? 'json' : 'md'}`, + `src/assets/${category}/${id}.${ext}`, + `dist/${category}/${id}/${id}.${ext}`, + `dist/${category}-editor/${id}/${id}.${ext}`, ]; };