diff --git a/index.js b/index.js index f7e9ae3..a04af1a 100644 --- a/index.js +++ b/index.js @@ -15,7 +15,7 @@ turnServer.start(() => { const app = express() const wsInstance = expressWs(app) -app.use(express.static('public')) +app.use(express.static('dist')) app.use(express.json()) app.use((req, res, next) => { if (req.method === 'CONNECT') { @@ -121,7 +121,7 @@ app.ws('/entanglement', (ws, req) => { // WEBHOOK 处理 GitHub 事件 app.post('/webhook', (req, res) => { console.log('WEBHOOK:' + new Date().toLocaleString()) - exec('git pull;npm i') + exec('git pull;npm i;npm run build') return res.json({ success: true }) }) diff --git a/vite.config.js b/vite.config.js index cc550ee..8a62dee 100644 --- a/vite.config.js +++ b/vite.config.js @@ -20,5 +20,8 @@ export default defineConfig({ }, plugins: [ WindiCSS(), - ] + ], + build: { + target: "esnext" + } })