Skip to content

Commit

Permalink
feat(cli): allow local .json files for presets (#1201)
Browse files Browse the repository at this point in the history
close #1068
  • Loading branch information
dhensche authored and yyx990803 committed May 3, 2018
1 parent f69231f commit 9766db1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/@vue/cli/lib/Creator.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const fs = require('fs-extra')
const chalk = require('chalk')
const debug = require('debug')
const execa = require('execa')
Expand Down Expand Up @@ -238,6 +239,8 @@ module.exports = class Creator {
error(`Failed fetching remote preset ${chalk.cyan(name)}:`)
throw e
}
} else if (name.endsWith('.json')) {
preset = await fs.readJson(name)
} else {
preset = savedPresets[name]
}
Expand Down

0 comments on commit 9766db1

Please sign in to comment.