This commit is contained in:
Rich Harris
2018-05-26 12:39:44 -04:00
parent 58d2f605fc
commit 8ba57969c2
2 changed files with 19 additions and 7 deletions

View File

@@ -148,7 +148,14 @@ class Watcher extends EventEmitter {
});
const restart = () => {
ports.wait(this.port).then(this.deferreds.server.fulfil);
ports.wait(this.port).then((() => {
this.emit('ready', <events.ReadyEvent>{
port: this.port,
process: this.proc
});
this.deferreds.server.fulfil();
}));
};
if (this.proc) {
@@ -165,11 +172,6 @@ class Watcher extends EventEmitter {
}, process.env),
stdio: ['ipc']
});
this.emit('ready', <events.ReadyEvent>{
port: this.port,
process: this.proc
});
});
}
});
@@ -190,7 +192,7 @@ class Watcher extends EventEmitter {
result: info => {
fs.writeFileSync(path.join(dest, 'client_info.json'), JSON.stringify(info));
fs.writeFileSync(path.join(dest, 'client_info.json'), JSON.stringify(info.assetsByChunkName, null, ' '));
fs.writeFileSync(path.join(dest, 'client_assets.json'), JSON.stringify(info.assetsByChunkName, null, ' '));
this.deferreds.client.fulfil();
const client_files = info.assets.map((chunk: { name: string }) => `client/${chunk.name}`);