Skip to content

[Feature request]vuepress build should throw the Error directly #598

Closed
@tyrion-yu

Description

@tyrion-yu

Feature request

What problem does this feature solve?

When vuepress dev, it's okey for a Vue Component to approach Browser Side Api like navigator.userAgent. But this can be wrong when vuepress build. Which means the user may ignore the potential mistakes when he push his code.

Recently I am trying to build a CONTINUOUS INTEGRATION with Jenkins to build vuepress docs automatically for my coworkers. VuePress catch the Error by itself when build, which makes the Jenkins scripts have no idea that there is something wrong with the build process. So I can't suggest the coworker to build locally to find out if there is anything abnormal.

What does the proposed API look like?

vuepress build should throw the Error directly. Or in some particular way, user can tell VuePress to throw the Error when something abnormal occurs.

How should this be implemented in your opinion?

program
  .command('build [targetDir]')
  .description('build dir as static site')
  .option('-d, --dest <outDir>', 'specify build output dir (default: .vuepress/dist)')
  .option('--debug', 'build in development mode for debugging')
  .action((dir = '.', { debug, dest }) => {
    const outDir = dest ? path.resolve(dest) : null
    // Do NOT catch the error
    // wrapCommand(build)(path.resolve(dir), { debug, outDir })
    build(path.resolve(dir), { debug, outDir })
  })

Are you willing to work on this yourself?**

I'm not sure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions