How to use the @vue/cli/lib/util/rcPath.getRcPath 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-ui / apollo-server / util / rcFolder.js View on Github external
const { getRcPath } = require('@vue/cli/lib/util/rcPath')

let folder

if (process.env.VUE_CLI_UI_TEST) {
  folder = path.resolve(__dirname, '../../live-test')
  // Clean DB
  fs.removeSync(path.resolve(__dirname, folder))
} else if (process.env.VUE_APP_CLI_UI_DEV) {
  folder = path.resolve(__dirname, '../../live')
} else {
  folder =
    (process.env.VUE_CLI_UI_DB_PATH &&
      path.resolve(__dirname, process.env.VUE_CLI_UI_DB_PATH)) ||
    getRcPath('.vue-cli-ui')
}

fs.ensureDirSync(path.resolve(__dirname, folder))

exports.rcFolder = folder
github KuangPF / vue-cli-analysis / packages / @vue / cli-ui / apollo-server / util / db.js View on Github external
const fs = require('fs-extra')
const path = require('path')
const { getRcPath } = require('@vue/cli/lib/util/rcPath')

let folder

if (process.env.VUE_CLI_UI_TEST) {
  folder = '../../live-test'
  // Clean DB
  fs.removeSync(path.resolve(__dirname, folder))
} else if (process.env.VUE_APP_CLI_UI_DEV) {
  folder = '../../live'
} else {
  folder = (
    process.env.VUE_CLI_UI_DB_PATH ||
    getRcPath('.vue-cli-ui')
  )
}

fs.ensureDirSync(path.resolve(__dirname, folder))

const db = new Lowdb(new FileSync(path.resolve(__dirname, folder, 'db.json')))

// Seed an empty DB
db.defaults({
  projects: [],
  foldersFavorite: [],
  tasks: [],
  config: {}
}).write()

module.exports = {