feat: apply feedback updates and streamline online delivery
Publish GitHub Pages output / publish (push) Successful in 34s
Publish GitHub Pages output / publish (push) Successful in 34s
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
import { readFile, rm, writeFile } from 'node:fs/promises';
|
||||
import path from 'node:path';
|
||||
|
||||
const output = path.resolve('pages-dist');
|
||||
const htmlPath = path.join(output, 'index.html');
|
||||
const scriptPath = path.join(output, 'assets', 'app.js');
|
||||
const stylePath = path.join(output, 'assets', 'app.css');
|
||||
|
||||
let html = await readFile(htmlPath, 'utf8');
|
||||
html = html.replace(/<script type="module" crossorigin src=/g, '<script defer src=');
|
||||
html = html.replace(/<link rel="stylesheet" crossorigin href=/g, '<link rel="stylesheet" href=');
|
||||
await writeFile(htmlPath, html);
|
||||
|
||||
let script = await readFile(scriptPath, 'utf8');
|
||||
script = script.replaceAll('/icons/', './icons/');
|
||||
await writeFile(scriptPath, script);
|
||||
|
||||
let style = await readFile(stylePath, 'utf8');
|
||||
style = style.replaceAll('/icons/', '../icons/');
|
||||
style += `
|
||||
.description-stat-icon { display: none !important; }
|
||||
.stat-badge .stat-icon,
|
||||
.filter-options label .stat-icon {
|
||||
width: auto !important;
|
||||
height: auto !important;
|
||||
background: none !important;
|
||||
mask: none !important;
|
||||
-webkit-mask: none !important;
|
||||
font-size: 12px;
|
||||
font-weight: 800;
|
||||
line-height: 1;
|
||||
}
|
||||
.stat-badge .stat-icon-performance::after,
|
||||
.filter-options label .stat-icon-performance::after { content: '퍼포먼스'; }
|
||||
.stat-badge .stat-icon-technique::after,
|
||||
.filter-options label .stat-icon-technique::after { content: '테크닉'; }
|
||||
.stat-badge .stat-icon-sense::after,
|
||||
.filter-options label .stat-icon-sense::after { content: '센스'; }
|
||||
`;
|
||||
await writeFile(stylePath, style);
|
||||
|
||||
// 채보는 app.js에 포함되므로 public 디렉터리에서 복사된 중복 파일은 제거한다.
|
||||
await rm(path.join(output, 'data'), { recursive: true, force: true });
|
||||
await rm(path.join(output, 'VERSION.txt'), { force: true });
|
||||
await writeFile(path.join(output, 'README.txt'), `홀로도리 계산기
|
||||
|
||||
서비스: https://doricalc-holo.live/
|
||||
|
||||
이 파일들은 GitHub Pages 배포용으로 자동 생성되었습니다.
|
||||
계산과 사용자 데이터 저장은 사용자의 브라우저에서 처리됩니다.
|
||||
`);
|
||||
Reference in New Issue
Block a user