diff options
author | 2021-03-25 14:06:08 -0400 | |
---|---|---|
committer | 2021-03-25 14:06:08 -0400 | |
commit | 3db595937719b89956c594e4a76ee68ae8de098a (patch) | |
tree | e463889925f71539f28730f957b195b1806b3cb0 /src/cli.ts | |
parent | 18e7cc5af903543ac6f46780bfea67c13c6517df (diff) | |
download | astro-3db595937719b89956c594e4a76ee68ae8de098a.tar.gz astro-3db595937719b89956c594e4a76ee68ae8de098a.tar.zst astro-3db595937719b89956c594e4a76ee68ae8de098a.zip |
First pass at the build (#27)
This updates `astro build` to do a production build. It works! No optimizations yet.
Diffstat (limited to 'src/cli.ts')
-rw-r--r-- | src/cli.ts | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/cli.ts b/src/cli.ts index 0a5c9612d..9d1815256 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -5,10 +5,14 @@ import { promises as fsPromises } from 'fs'; import yargs from 'yargs-parser'; import { loadConfig } from './config.js'; -import generate from './generate.js'; +import {build} from './build.js'; import devServer from './dev.js'; const { readFile } = fsPromises; +const buildAndExit = async (...args: Parameters<typeof build>) => { + const ret = await build(...args); + process.exit(ret); +} type Arguments = yargs.Arguments; type cliState = 'help' | 'version' | 'dev' | 'build'; @@ -61,7 +65,7 @@ async function runCommand(rawRoot: string, cmd: (a: AstroConfig) => Promise<void } const cmdMap = new Map([ - ['build', generate], + ['build', buildAndExit], ['dev', devServer], ]); |