From 9766db103f4880ecf30ce7a43dbf9c2f4e46503c Mon Sep 17 00:00:00 2001 From: Derek Henscheid Date: Thu, 3 May 2018 14:52:57 -0500 Subject: [PATCH] feat(cli): allow local .json files for presets (#1201) close #1068 --- packages/@vue/cli/lib/Creator.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/@vue/cli/lib/Creator.js b/packages/@vue/cli/lib/Creator.js index 9e7deab82b..6ef511ab6d 100644 --- a/packages/@vue/cli/lib/Creator.js +++ b/packages/@vue/cli/lib/Creator.js @@ -1,3 +1,4 @@ +const fs = require('fs-extra') const chalk = require('chalk') const debug = require('debug') const execa = require('execa') @@ -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] }