Skip to content

Commit 63ec031

Browse files
committed
feat(cli): appId support, base path handling
1 parent 52c761d commit 63ec031

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

src/cli.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -505,16 +505,14 @@ cli
505505
)
506506
.action(async (root: string, options: ServerOptions & GlobalCLIOptions) => {
507507
filterDuplicateOptions(options);
508-
const { next } = await safeNextImport();
508+
const { next, constants } = await safeNextImport();
509+
const { PHASE_DEVELOPMENT_SERVER } = constants;
509510

510511
let nextApp: null | ReturnType<typeof next> = null;
511512
let httpServer: any = null;
512513
let configWatcher: ConfigWatcher | null = null;
513514
let isRestarting = false;
514515

515-
const projectRoot = root
516-
? path.resolve(process.cwd(), root)
517-
: process.cwd();
518516
const logger = createLogger();
519517

520518
const startNextServer = async () => {
@@ -586,7 +584,7 @@ cli
586584
logger.info(projectRoot);
587585

588586
// Get pp-dev config from Next.js app config
589-
const config = await loadConfig('development', projectRoot);
587+
const config = await loadConfig(PHASE_DEVELOPMENT_SERVER, projectRoot);
590588

591589
// Extract pp-dev configuration from Next.js config
592590
let ppDevConfig = config?.ppDev || {};

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ function createBasePath(
167167
}
168168
}
169169

170-
return `${templateLess ? pathPagePrefix : pathTemplatePrefix}/${templateName}`;
170+
return `/p/${templateName}`;
171171
}
172172

173173
/**

0 commit comments

Comments
 (0)