mirror of
https://github.com/sern-handler/website
synced 2026-06-06 01:16:47 +00:00
Update build.mdx
This commit is contained in:
@@ -12,12 +12,14 @@ Options:
|
||||
-f --format [fmt] The module system of your application. `cjs` or `esm` (default: "esm")
|
||||
-m --mode [mode] the mode for sern to build in. `production` or `development` (default: "development")
|
||||
-w --watch
|
||||
--watch-command [cmd] the command for sern to watch. if watch is not enabled, an error is thrown (default: "")
|
||||
-W --suppress-warnings suppress experimental warning
|
||||
-p --project [filePath] build with the provided sern.build file
|
||||
-e --env path to .env file
|
||||
--source-maps Whether to add source-maps to configuration (default: false)
|
||||
--tsconfig [filePath] Use this tsconfig
|
||||
-h, --help display help for command
|
||||
|
||||
```
|
||||
|
||||
## Guiding Principles
|
||||
@@ -105,6 +107,16 @@ type BuildOptions = {
|
||||
* default to .env.
|
||||
*/
|
||||
env?: string;
|
||||
|
||||
// options for watch
|
||||
watch?: {
|
||||
/**
|
||||
* command to run.
|
||||
* defaults to your package
|
||||
* manager's start command.
|
||||
*/
|
||||
command?: string;
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
@@ -135,11 +147,17 @@ the watch flag needs a `start` command. Depending on the **lock file** in your p
|
||||
if (pathExistsSync('bun.lock')) return 'bun start';
|
||||
```
|
||||
|
||||
|
||||
:::tip
|
||||
supply a custom watch command with the watchCommand option. If you want sern build to only watch the build process, and not rerunning your bot,
|
||||
watchCommand should be set **exactly** to `''`
|
||||
supply a custom watch command with the watch.command option. If you want sern build to only watch the build process, and not rerunning your bot,
|
||||
watchCommand should be set **exactly** to `''` (an empty string)
|
||||
:::
|
||||
|
||||
:::tip
|
||||
The supplied watch command is [debounced](https://www.geeksforgeeks.org/debouncing-in-javascript/) to 1.5 seconds.
|
||||
:::
|
||||
|
||||
|
||||
import VideoUrl from "~/assets/docs/watch-example2.mp4"
|
||||
|
||||
<video width="640" height="360" controls type="video/mp4">
|
||||
|
||||
Reference in New Issue
Block a user