优化打包方法

This commit is contained in:
aixianling
2023-01-18 12:08:51 +08:00
parent de3549d82e
commit 766faee96e
7 changed files with 124 additions and 14 deletions

14
src/websocket/index.js Normal file
View File

@@ -0,0 +1,14 @@
const {findFile} = require("../utils/fsUtils");
const chalk = require("chalk");
const {log} = console
module.exports = {
init: ins => {
return findFile('./src/websocket', file => {
if (!/index\.js/.test(file)) {
const ws = require(file.replace(/src[\\\/]websocket/, '.'))
log(`${chalk.bgBlue.black(" WEBSOCKET ")} ${ws.action}`)
ins.ws(ws.action, ws.execute)
}
})
}
}