

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



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

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

module.exports = previewDoc
