How to use the @vuepress/core/package.json.version function in @vuepress/core

To help you get started, we’ve selected a few @vuepress/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vuejs / vuepress / packages / vuepress / cli.js View on Github external
async beforeParse (cli) {
    const pkg = require('@vuepress/core/package.json')
    checkEnv(pkg)
    registerCoreCommands(cli, OPTIONS)
    await handleUnknownCommand(cli, OPTIONS)
    cli.version(pkg.version).help()
  },
github vuejs / vuepress / packages / @vuepress / cli / index.js View on Github external
exports.bootstrap = function ({
  plugins,
  theme
} = {}) {
  const { path, logger, env } = require('@vuepress/shared-utils')
  const { dev, build, eject } = require('@vuepress/core')

  cli
    .version(pkg.version)
    .help()

  cli
    .command('dev [targetDir]', 'start development server')
    .option('-p, --port ', 'use specified port (default: 8080)')
    .option('-t, --temp ', 'set the directory of the temporary file')
    .option('-c, --cache [cache]', 'set the directory of cache')
    .option('--host ', 'use specified host (default: 0.0.0.0)')
    .option('--no-cache', 'clean the cache before build')
    .option('--debug', 'start development server in debug mode')
    .option('--silent', 'start development server in silent mode')
    .action((sourceDir = '.', options) => {
      const {
        host,
        port,
        debug,