Web Dev Solutions

Catalin Mititiuc

aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--esbuild-server.mjs14
1 files changed, 13 insertions, 1 deletions
diff --git a/esbuild-server.mjs b/esbuild-server.mjs
index 2421f23..906ff63 100644
--- a/esbuild-server.mjs
+++ b/esbuild-server.mjs
@@ -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}`);