mirror of
https://gitee.com/docsifyjs/docsify.git
synced 2024-11-29 18:48:14 +08:00
1c5a7013f1
- Replace live-server with existing Browsersync dependency as web server - Remove duplicate `index.html` file - Add `build:html` script to generate `/docs/preview.html`
14 lines
453 B
JavaScript
14 lines
453 B
JavaScript
import { create } from 'browser-sync';
|
|
import serverConfigs from './server.config.js';
|
|
|
|
const bsServer = create();
|
|
const args = process.argv.slice(2);
|
|
const configName =
|
|
Object.keys(serverConfigs).find(name => args.includes(`--${name}`)) || 'prod';
|
|
const settings = serverConfigs[configName];
|
|
|
|
// prettier-ignore
|
|
console.log(`\nStarting ${configName} server (${settings.server.index}, watch: ${Boolean(settings.files)})\n`);
|
|
|
|
bsServer.init(settings);
|