condorheroblog / vuepress-plugin-export-pdf

VuePress plugin exports PDF 📁.
MIT License
22 stars 2 forks source link

Does not load the `vuepress-next` config file set by the user #12

Closed condorheroblog closed 1 year ago

condorheroblog commented 1 year ago

@condorhero/vuepress-plugin-export-pdf-v2 starts the service using the createDev API, but createDev needs to expose the incoming user config as it won't be loaded automatically.

https://github.com/vuepress/vuepress-next/blob/42c0bc2a352f85e0b4029e18a8a3270736e54229/packages/cli/src/commands/dev/createDev.ts#L35-L54

const userConfigPath = commandOptions.config
      ? resolveUserConfigPath(commandOptions.config)
      : resolveUserConfigConventionalPath(cliAppConfig.source)
    const { userConfig, userConfigDependencies } = await loadUserConfig(
      userConfigPath
    )

    // resolve the final app config to use
    const appConfig = resolveAppConfig({
      defaultAppConfig,
      cliAppConfig,
      userConfig,
    })
    if (appConfig === null) {
      return
    }

    // create vuepress app
    const app = createDevApp(appConfig)