Skip to content

Commit

Permalink
fix: compatibility issue with Nuxt 2.15.0
Browse files Browse the repository at this point in the history
Resolves #1063
  • Loading branch information
rchl committed Feb 15, 2021
1 parent e9f2a6a commit 9d276d7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ export function buildHook (moduleContainer, options) {
// Add vue-i18n-loader if applicable
if (options.vueI18nLoader) {
moduleContainer.extendBuild(config => {
const loaders = config.module.rules.find(el => el.loader === 'vue-loader').options.loaders
if (loaders) {
const vueLoader = config.module.rules.find(el => el.loader.includes('vue-loader'))
if (vueLoader && vueLoader.options && vueLoader.options.loaders) {
// vue-loader under 15.0.0
/* istanbul ignore next */
loaders.i18n = '@intlify/vue-i18n-loader'
vueLoader.options.loaders.i18n = '@intlify/vue-i18n-loader'
} else {
// vue-loader after 15.0.0
config.module.rules.push({
Expand Down

0 comments on commit 9d276d7

Please sign in to comment.