Merge branch 'next' into cem-better-data

This commit is contained in:
Cory LaViska
2022-11-28 11:51:20 -05:00
11 changed files with 164 additions and 131 deletions

View File

@@ -46,6 +46,9 @@ fs.mkdirSync(outdir, { recursive: true });
format: 'esm',
target: 'es2017',
entryPoints: [
//
// NOTE: Entry points must be mapped in package.json > exports, otherwise users won't be able to import them!
//
// The whole shebang
'./src/shoelace.ts',
// Components
@@ -131,22 +134,9 @@ fs.mkdirSync(outdir, { recursive: true });
// Launch browser sync
bs.init(browserSyncConfig, () => {
// This init callback gets executed after the server has started
const socketIoConfig = browserSyncConfig.socket.socketIoClientConfig;
// Wait enough time for any open, detached clients to have a chance to reconnect. This will be used to determine
// if we reload an existing tab or open a new one.
const tabReattachDelay = socketIoConfig.reconnectionDelayMax * 2 + socketIoConfig.timeout;
setTimeout(() => {
const url = `http://localhost:${port}`;
console.log(chalk.cyan(`Launched the Shoelace dev server at ${url} 🥾\n`));
if (Object.keys(bs.sockets.sockets).length === 0) {
open(url);
} else {
bs.reload();
}
}, tabReattachDelay);
const url = `http://localhost:${port}`;
console.log(chalk.cyan(`Launched the Shoelace dev server at ${url} 🥾\n`));
open(url);
});
// Rebuild and reload when source files change