0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00
astro/vscode/scripts/watch.mjs

28 lines
557 B
JavaScript
Raw Normal View History

import esbuild from 'esbuild';
import config from './esbuild.config.mjs';
function buildClient() {
return esbuild.build({
...config,
watch: true,
entryPoints: ['packages/client/src/index.ts'],
outfile: 'dist/index.js',
});
}
function buildServer() {
return esbuild.build({
...config,
watch: true,
entryPoints: ['packages/server/src/index.ts'],
outfile: 'dist/server.js',
});
}
async function watch() {
await Promise.all([buildClient(), buildServer()]);
console.log('👀 Watching for changes...');
}
watch();