function serve()

in scripts/preview.js [15:30]


function serve() {
	let server;

	function toExit() {
		if (server) server.kill(0);
	}
    
    if (server) return;
    server = spawn('npm', ['run', 'start', '--', '--dev'], {
        stdio: ['ignore', 'inherit', 'inherit'],
        shell: true
    });

    process.on('SIGTERM', toExit);
    process.on('exit', toExit);
}