import { mergeConfig } from '../../utils/doc-methods'
import { DOC_ROOT_PATH } from '../../constant/doc'
const { npm } = require('../../utils/npm')

async function previewDoc() {
  // 合并storybook配置
  mergeConfig()

  // 启动storybook
  npm(['run', 'storybook'], {
    cwd: DOC_ROOT_PATH,
  })
}

export default previewDoc
