diff --git a/src/build.ts b/src/build.ts index fb8f1dc9cf..a0134474c9 100644 --- a/src/build.ts +++ b/src/build.ts @@ -17,6 +17,7 @@ import { parseNodeModulePath, resolvePath, } from "mlly"; +import { upperFirst } from "scule"; import { version as nitroVersion } from "../package.json"; import { generateFSTree } from "./utils/tree"; import { getRollupConfig, RollupConfig } from "./rollup/config"; @@ -482,10 +483,19 @@ function startRollupWatcher(nitro: Nitro, rollupConfig: RollupConfig) { // Finished building all bundles case "END": { nitro.hooks.callHook("compiled", nitro); - nitro.logger.success( - "Nitro built", - start ? `in ${Date.now() - start} ms` : "" - ); + + if (nitro.options.logging.devBuildSuccess) { + let message = `Nitro Server`; + if (nitro.options.framework.name !== "nitro") { + const _name = upperFirst(nitro.options.framework.name); + message = `${_name} ${message}`; + } + nitro.logger.success( + `${message} built`, + start ? `in ${Date.now() - start} ms` : "" + ); + } + nitro.hooks.callHook("dev:reload"); return; } diff --git a/src/options.ts b/src/options.ts index de1f4a4e48..cfda908289 100644 --- a/src/options.ts +++ b/src/options.ts @@ -73,6 +73,7 @@ const NitroDefaults: NitroConfig = { // Logging logging: { compressedSizes: true, + devBuildSuccess: true, }, // Routing diff --git a/src/types/nitro.ts b/src/types/nitro.ts index 5f15ea261a..344ab31ce9 100644 --- a/src/types/nitro.ts +++ b/src/types/nitro.ts @@ -309,6 +309,7 @@ export interface NitroOptions extends PresetOptions { // Logging logging: { compressedSizes: boolean; + devBuildSuccess: boolean; }; // Routing