Skip to content

Commit

Permalink
feat: add cms url to dev server output
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenle committed Dec 5, 2023
1 parent 6a77ba6 commit dfe4772
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/root/src/cli/commands/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ export async function dev(rootProjectDir?: string, options?: DevOptions) {
console.log();
console.log(`${dim('┃')} project: ${rootDir}`);
console.log(`${dim('┃')} server: http://${host}:${port}${basePath}`);
if (testCmsEnabled(rootConfig)) {
console.log(`${dim('┃')} cms: http://${host}:${port}/cms/`);
}
console.log(`${dim('┃')} mode: development`);
console.log();
server.listen(port, host);
Expand Down Expand Up @@ -232,3 +235,8 @@ function rootDevServer500Middleware() {
next(err);
};
}

function testCmsEnabled(rootConfig: RootConfig) {
const plugins = rootConfig.plugins || [];
return Boolean(plugins.find((plugin) => plugin.name === 'root-cms'));
}

0 comments on commit dfe4772

Please sign in to comment.