Browse Source

fix: cannot read config

master
smallstonesk 4 years ago
parent
commit
a802aab0de
  1. 2
      packages/cli/index.js
  2. 4
      packages/cli/src/cmd/dev/index.js

2
packages/cli/index.js

@ -14,7 +14,7 @@ program
Object.keys(cmds).forEach((cmd) => {
const CmdCtor = cmds[cmd];
if(program[cmd]) {
const cmdInst = new CmdCtor(getConfig());
const cmdInst = new CmdCtor({config: getConfig()});
cmdInst.run();
}
});

4
packages/cli/src/cmd/dev/index.js

@ -10,7 +10,7 @@ const TPL_PATH = path.join(__dirname, './template');
class Dev extends Base {
async save(req, res) {
save = async (req, res) => {
const {outputPath} = this.config;
@ -40,7 +40,7 @@ class Dev extends Base {
run() {
const app = createServer();
app.post('/api/save', save);
app.post('/api/save', this.save);
}
}

Loading…
Cancel
Save