Add build start time to server

This commit is contained in:
Catalin Constantin Mititiuc 2025-06-16 22:41:31 -07:00
parent de4ee97dce
commit b5d73d9ad0

View File

@ -154,7 +154,11 @@ const svgUseCacheBust = {
const resolveSvgImports = {
name: 'resolveSvgImports',
setup(build) {
let buildStart;
build.onStart(() => {
buildStart = Date.now();
console.log('Build started');
fs.rmSync(path.resolve(build.initialOptions.outdir), { recursive: true, force: true });
});
@ -163,6 +167,10 @@ const resolveSvgImports = {
path: path.resolve('public', args.path),
};
});
build.onEnd(() => {
console.log(`Build completed in ${Date.now() - buildStart}ms`);
});
}
}
@ -283,4 +291,8 @@ http.createServer((req, res) => {
req.pipe(proxyReq, { end: true });
}
}).listen(8080);
}).listen(8080, (e) => {
console.log('server is online', e);
});
// console.log(`${process.env.NODE_ENV === 'test' ? 'Test' : 'Development'} server running at ${server.url}`);