async resolveConfigAndInitialize () {
    if (this.options.siteConfig) {
      this.siteConfig = this.options.siteConfig
    } else {
      let siteConfig = await loadConfig(this.vuepressDir)
      if (isFunction(siteConfig)) {
        siteConfig = await siteConfig(this)
      }
      this.siteConfig = siteConfig
    }

    // TODO custom cwd.
    this.cwd = process.cwd()

    this.base = this.siteConfig.base || '/'
    this.themeConfig = this.siteConfig.themeConfig || {}

    // resolve tempPath
    const rawTemp = this.options.temp || this.siteConfig.temp
    const { tempPath, writeTemp } = createTemp(rawTemp)
    this.tempPath = tempPath
    this.writeTemp = writeTemp

    // resolve outDir
    const rawOutDir = this.options.dest || this.siteConfig.dest
    this.outDir = rawOutDir
      ? require('path').resolve(this.cwd, rawOutDir)
      : require('path').resolve(this.sourceDir, '.vuepress/dist')

    this.pages = [] // Array<Page>
    this.pluginAPI = new PluginAPI(this)
    this.ClientComputedMixinConstructor = ClientComputedMixin(this.getSiteData())
  }
Resolve user config and initialize.

@returns {Promise<void>}
@api private