ensure dev client is not imported if server imports client.js

This commit is contained in:
Rich Harris
2018-10-01 12:13:03 -04:00
parent 278be67228
commit 6a74097b0c

View File

@@ -127,9 +127,11 @@ function generate_client(
footer = ` footer = `
import(${stringify(sapper_dev_client)}).then(client => { if (typeof window !== 'undefined') {
client.connect(${dev_port}); import(${stringify(sapper_dev_client)}).then(client => {
});`.replace(/^\t{3}/gm, ''); client.connect(${dev_port});
});
}`.replace(/^\t{3}/gm, '');
} }
return `// This file is generated by Sapper — do not edit it!\n` + template return `// This file is generated by Sapper — do not edit it!\n` + template