mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-20 22:35:09 +00:00
oops
This commit is contained in:
@@ -148,7 +148,14 @@ class Watcher extends EventEmitter {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const restart = () => {
|
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) {
|
if (this.proc) {
|
||||||
@@ -165,11 +172,6 @@ class Watcher extends EventEmitter {
|
|||||||
}, process.env),
|
}, process.env),
|
||||||
stdio: ['ipc']
|
stdio: ['ipc']
|
||||||
});
|
});
|
||||||
|
|
||||||
this.emit('ready', <events.ReadyEvent>{
|
|
||||||
port: this.port,
|
|
||||||
process: this.proc
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -190,7 +192,7 @@ class Watcher extends EventEmitter {
|
|||||||
|
|
||||||
result: info => {
|
result: info => {
|
||||||
fs.writeFileSync(path.join(dest, 'client_info.json'), JSON.stringify(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();
|
this.deferreds.client.fulfil();
|
||||||
|
|
||||||
const client_files = info.assets.map((chunk: { name: string }) => `client/${chunk.name}`);
|
const client_files = info.assets.map((chunk: { name: string }) => `client/${chunk.name}`);
|
||||||
|
|||||||
@@ -17,6 +17,16 @@ export function dev(opts: { port: number, open: boolean }) {
|
|||||||
if (opts.open) child_process.exec(`open http://localhost:${event.port}`);
|
if (opts.open) child_process.exec(`open http://localhost:${event.port}`);
|
||||||
first = false;
|
first = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO clear screen?
|
||||||
|
|
||||||
|
event.process.stdout.on('data', data => {
|
||||||
|
process.stdout.write(data);
|
||||||
|
});
|
||||||
|
|
||||||
|
event.process.stderr.on('data', data => {
|
||||||
|
process.stderr.write(data);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
watcher.on('invalid', (event: events.InvalidEvent) => {
|
watcher.on('invalid', (event: events.InvalidEvent) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user