Compare commits

...

4 Commits

Author SHA1 Message Date
konnorrogers
9673cffbdd prettier 2025-08-01 13:02:22 -04:00
konnorrogers
3fc64d264b Merge branch 'next' of https://github.com/shoelace-style/webawesome into konnorrogers/fix-build-reloading-2 2025-07-28 20:01:20 -04:00
konnorrogers
6af206d193 Merge branch 'next' of https://github.com/shoelace-style/webawesome into konnorrogers/fix-build-reloading-2 2025-07-28 11:45:58 -04:00
Konnor Rogers
1d748533c1 fix build reloading 2025-07-28 10:04:43 -04:00

View File

@@ -464,7 +464,25 @@ export async function build(options = {}) {
function handleWatchEvent(evt) {
return async filename => {
spinner.info(`File modified ${chalk.gray(`(${relative(getRootDir(), filename)})`)}`);
const changedFile = relative(getRootDir(), filename);
let message = '';
if (evt === 'change') {
message = chalk.blue(`File modified ${chalk.gray(`(${changedFile})`)}`);
} else if (evt === 'unlink') {
message = chalk.red(`File deleted ${chalk.gray(`(${changedFile})`)}`);
} else if (evt === 'add') {
message = chalk.green(`File added ${chalk.gray(`(${changedFile})`)}`);
}
if (message) {
if (spinner) {
spinner.info(message);
} else {
console.log(message);
}
}
if (typeof options.beforeWatchEvent === 'function') {
await options.beforeWatchEvent(evt, filename);
}