mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
feat(cli): allow to custom server.port (#11222)
This commit is contained in:
parent
cedbc089b4
commit
d9fe675af4
@ -114,12 +114,12 @@ export function smartOutputFile(filePath: string, content: string) {
|
|||||||
outputFileSync(filePath, content);
|
outputFileSync(filePath, content);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function mergeCustomViteConfig(config: InlineConfig) {
|
export function mergeCustomViteConfig(config: InlineConfig): InlineConfig {
|
||||||
const vantConfig = getVantConfig();
|
const vantConfig = getVantConfig();
|
||||||
const configureVite = vantConfig.build?.configureVite;
|
const configureVite = vantConfig.build?.configureVite;
|
||||||
|
|
||||||
if (configureVite) {
|
if (configureVite) {
|
||||||
return configureVite(config);
|
return configureVite(config) || config;
|
||||||
}
|
}
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ export async function compileSite(production = false) {
|
|||||||
} else {
|
} else {
|
||||||
const config = mergeCustomViteConfig(getViteConfigForSiteDev());
|
const config = mergeCustomViteConfig(getViteConfigForSiteDev());
|
||||||
const server = await createServer(config);
|
const server = await createServer(config);
|
||||||
await server.listen();
|
await server.listen(config.server?.port);
|
||||||
|
|
||||||
const require = createRequire(import.meta.url);
|
const require = createRequire(import.meta.url);
|
||||||
const { version } = require('vite/package.json');
|
const { version } = require('vite/package.json');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user