This commit is contained in:
Jacob Nguyen
2024-05-10 17:59:19 -05:00
parent 4fb85d5f70
commit 08bb490d26
2 changed files with 4 additions and 2 deletions

View File

@@ -142,8 +142,9 @@ export async function build(options: Record<string, any>) {
dropLabels: [buildConfig.mode === 'production' ? '__DEV__' : '__PROD__', ...buildConfig.dropLabels!],
});
if(options.watch) {
await ctx.watch()
} else {
ctx.rebuild()
ctx.dispose()
await ctx.rebuild()
await ctx.dispose()
}
}

View File

@@ -66,6 +66,7 @@ program
.description('Build your bot')
.option('-f --format [fmt]', 'The module system of your application. `cjs` or `esm`', 'esm')
.option('-m --mode [mode]', 'the mode for sern to build in. `production` or `development`', 'development')
.option('-w --watch')
.option('-W --suppress-warnings', 'suppress experimental warning')
.option('-p --project [filePath]', 'build with the provided sern.build file')
.option('-e --env', 'path to .env file')