'初始化提交'

This commit is contained in:
2025-08-11 22:55:39 +08:00
parent 3deaf322c6
commit 9ec6daa82b
212 changed files with 45916 additions and 0 deletions

24
beforebuild.js Normal file
View File

@@ -0,0 +1,24 @@
// 引入babel模块
const babel = require("@babel/core");
// 引入fs模块
const fs = require("fs");
// 引入path模块
const path = require("path");
// 获取js目录下名为index.js的文件
const filePath = path.resolve(__dirname, "./www/js/index.js");
// 转译async/await
babel.transformFile(
filePath,
{
plugins: ["@babel/plugin-transform-async-to-generator"],
},
(err, result) => {
if (err) throw err;
// 把转译后的代码写入到index.build.js文件中
fs.writeFile("./www/js/index.build.js", result.code, err => {
if (err) throw err;
console.log("转译成功");
});
}
);