From 63192eceb17926325fe3f2f5493766e2b9aaaed8 Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Wed, 27 Jun 2018 17:33:07 +0900 Subject: [PATCH] :boom: breaking(config): plugin options namespaced --- generator/index.js | 6 +++++- prompts.js | 2 +- ui.js | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/generator/index.js b/generator/index.js index b3de4b2..e5cddc9 100644 --- a/generator/index.js +++ b/generator/index.js @@ -48,7 +48,11 @@ module.exports = (api, options, rootOptions) => { 'vue-i18n': '^8.0.0' }, vue: { - pluginOptions: { locale, fallbackLocale, localeDir, enableInSFC } + pluginOptions: { + i18n: { + locale, fallbackLocale, localeDir, enableInSFC + } + } } } diff --git a/prompts.js b/prompts.js index ba3e109..00dccdd 100644 --- a/prompts.js +++ b/prompts.js @@ -7,7 +7,7 @@ module.exports = [{ }, { type: 'input', name: 'fallbackLocale', - message: 'The locale of project fallback localization.', + message: 'The fallback locale of project localization.', validate: input => !!input, default: 'en' }, { diff --git a/ui.js b/ui.js index 7ad5cc0..27a882f 100644 --- a/ui.js +++ b/ui.js @@ -101,7 +101,9 @@ module.exports = api => { api.onPluginReload(project => { debug('onPluginReload', project) const rawConfig = require(`${project.path}/vue.config`) - const config = rawConfig.pluginOptions || { localeDir: 'locales' } + const config = (rawConfig.pluginOptions && rawConfig.pluginOptions.i18n) + ? rawConfig.pluginOptions.i18n + : { localeDir: 'locales' } if (!config.localeDir) { config.localeDir = 'locales' } debug('onPluginReload : load vue.config', config) setupAddon(project.path, config)