feat: 新增直接打开dist/index.html文件访问的功能

新增命令build:file打包项目,可通过直接打开index.html访问
This commit is contained in:
log1997
2024-12-26 18:26:05 +08:00
parent 1b7f01f106
commit 84fd44f41e
6 changed files with 1353 additions and 68 deletions

9
HandleHTML.js Normal file
View File

@@ -0,0 +1,9 @@
import fs from "fs";
const htmlPath = "./dist/index.html"; // 打包后的html文件路径
const htmlText = fs.readFileSync(htmlPath, 'utf8');
const result = htmlText.replace(/\/log-lottery/g, '.')
console.log(result)
fs.writeFileSync(htmlPath, result, 'utf8');
console.log("处理完成");