feat: 新增直接打开dist/index.html文件访问的功能
新增命令build:file打包项目,可通过直接打开index.html访问
This commit is contained in:
9
HandleHTML.js
Normal file
9
HandleHTML.js
Normal 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("处理完成");
|
||||
Reference in New Issue
Block a user