Skip to content

Commit

Permalink
feat(cli): allow to custom server.port (youzan#11222)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan authored Nov 5, 2022
1 parent cedbc08 commit d9fe675
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/vant-cli/src/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,12 @@ export function smartOutputFile(filePath: string, content: string) {
outputFileSync(filePath, content);
}

export function mergeCustomViteConfig(config: InlineConfig) {
export function mergeCustomViteConfig(config: InlineConfig): InlineConfig {
const vantConfig = getVantConfig();
const configureVite = vantConfig.build?.configureVite;

if (configureVite) {
return configureVite(config);
return configureVite(config) || config;
}
return config;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/vant-cli/src/compiler/compile-site.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export async function compileSite(production = false) {
} else {
const config = mergeCustomViteConfig(getViteConfigForSiteDev());
const server = await createServer(config);
await server.listen();
await server.listen(config.server?.port);

const require = createRequire(import.meta.url);
const { version } = require('vite/package.json');
Expand Down

0 comments on commit d9fe675

Please sign in to comment.