mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
18e7cc5af9
* wip: scaffold astro extension * wip: scaffold astro extension * WIP: vscode extension * fix: autoCloseBefore * chore: update package.json * fix: use tsx instead of plain ts * chore: remove dist files * chore: remove comments * chore: cleanup package build process, switch build to esbuild * refactor: use shared esbuild config Co-authored-by: Nate Moore <nate@skypack.dev>
27 lines
557 B
JavaScript
27 lines
557 B
JavaScript
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();
|