egg 一个简洁实例 启动不了
发布于 6 年前 作者 spitWind 3161 次浏览 来自 问答
const Application = require('egg').Application;
const app = new Application({
  framework: '/home/hwx/Wchat/wServer/node_modules/egg',
  baseDir: '/home/hwx/Wchat/wServer/',
  workers: 1,
  plugins: null,
  https: false,
  isDebug: true,
  clusterPort: 39257,
  port: 7001
})

// app.emit('server', server);
const server = require('http').createServer(app.callback()).listen(7001);
app.ready(function (params) {
  server.emit('listening');
})

[egg:core:ready_timeout] // 把 node_modules/_egg-core@4.9.1@egg-core/lib/loader/mixin/custom.js 第28行

     .forEach```
后面加入 

unit => {

    if(unit.path.includes("egg-watcher"))
      return;
  // console.log(unit);
    return this.loadFile(this.resolveModule(path.join(unit.path, 'app')))
  }
就不会模块加载超时了    
然后用devtool 启动就启动...   
话说我这么折腾干嘛...
回到顶部