Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Commit

Permalink
💥 breaking(config): plugin options namespaced
Browse files Browse the repository at this point in the history
  • Loading branch information
kazupon committed Jun 27, 2018
1 parent 4906ecc commit 63192ec
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 5 additions & 1 deletion generator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion prompts.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}, {
Expand Down
4 changes: 3 additions & 1 deletion ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 63192ec

Please sign in to comment.