diff options
author | 2021-03-25 10:38:17 -0500 | |
---|---|---|
committer | 2021-03-25 10:38:17 -0500 | |
commit | 18e7cc5af903543ac6f46780bfea67c13c6517df (patch) | |
tree | f61100a6adf3d4641cab89a23ac071268ed911e2 /vscode/scripts/watch.mjs | |
parent | 30cccdf7154b6470e876464da9e412af10894dd5 (diff) | |
download | astro-18e7cc5af903543ac6f46780bfea67c13c6517df.tar.gz astro-18e7cc5af903543ac6f46780bfea67c13c6517df.tar.zst astro-18e7cc5af903543ac6f46780bfea67c13c6517df.zip |
Scaffold language server (#25)
* 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>
Diffstat (limited to 'vscode/scripts/watch.mjs')
-rw-r--r-- | vscode/scripts/watch.mjs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/vscode/scripts/watch.mjs b/vscode/scripts/watch.mjs new file mode 100644 index 000000000..37bdc53e6 --- /dev/null +++ b/vscode/scripts/watch.mjs @@ -0,0 +1,27 @@ +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(); |