mirror of
https://github.com/sern-handler/cli
synced 2026-06-06 01:16:53 +00:00
watch
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user