scripts: convert to ESM and deduplicate #290
Loading…
Reference in a new issue
No description provided.
Delete branch "scripts-esm"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This makes it a bit easier to add any new files that may need to be
cleaned up in the future.
Also allows us to use top-level await for the
yarn dev
task.@ -0,0 +13,4 @@
stderr: process.stderr,
});
execa('npx', ['gulp', 'watch'], {
Why are some of these
await
ed and some not?These were the case in the original
dev.js
script, not sure if we should just run all of these processes asynchronously.I think the first two do need the
await
since it doesn't make sense to clean asynchronously and pretty much every package depends onfoundkey-js
being built.The first two produce a result (cleaning out stuff, building things), the non-awaited commands are watchers, where you probably will have a hard time waiting for a result being returned.
@ -0,0 +46,4 @@
});
} catch (e) {
await new Promise(resolve => setTimeout(resolve, 3000));
start();
Can't this be simplified to just
setTimeout(start, 3000);
?Hmm I'm not so sure any more but I think the change was fine because
start
isn't awaited on anyway...