mirror of
https://gitee.com/docsifyjs/docsify.git
synced 2024-11-29 18:48:14 +08:00
15 lines
552 B
JavaScript
15 lines
552 B
JavaScript
import { create } from 'browser-sync';
|
|
import { devConfig, prodConfig } from './server.configs.js';
|
|
|
|
const bsServer = create();
|
|
const args = process.argv.slice(2);
|
|
const config = args.includes('--dev') ? devConfig : prodConfig;
|
|
const configName = config === devConfig ? 'development' : 'production';
|
|
const isWatch = Boolean(config.files) && config.watch !== false;
|
|
const urlType = config === devConfig ? 'local' : 'CDN';
|
|
|
|
// prettier-ignore
|
|
console.log(`\nStarting ${configName} server (${urlType} URLs, watch: ${isWatch})\n`);
|
|
|
|
bsServer.init(config);
|