How to use the @vue/cli/lib/options.loadOptions function in @vue/cli

To help you get started, we’ve selected a few @vue/cli 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 / vue-cli / packages / @vue / cli-test-utils / assertPromptModule.js View on Github external
{
        message: 'Please pick a preset',
        choose: 1
      }
    )
    expectedPrompts.push(
      {
        message: 'Where do you prefer placing config',
        choose: 1 // package.json
      },
      {
        message: 'Save this as a preset',
        confirm: false
      }
    )
    if (!loadOptions().packageManager) {
      expectedPrompts.push({
        message: 'package manager',
        choose: 0 // yarn
      })
    }
  }

  expectPrompts(expectedPrompts)
  const creator = new Creator('test', '/', [].concat(module))
  const preset = await creator.promptAndResolvePreset()

  if (opts.pluginsOnly) {
    delete preset.useConfigFiles
  }
  expect(preset).toEqual(expectedOptions)
}
github vuejs / vue-cli / packages / @vue / cli-ui / apollo-server / util / command.js View on Github external
exports.getCommand = function (cwd = undefined) {
  if (!cwd) {
    return loadOptions().packageManager || (hasYarn() ? 'yarn' : hasPnpm3OrLater() ? 'pnpm' : 'npm')
  }
  return hasProjectYarn(cwd) ? 'yarn' : hasProjectPnpm(cwd) ? 'pnpm' : 'npm'
}