Skip to content

Commit

Permalink
feat: Support vue-loader >=15.0.0 (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wangye Zhao authored and paulgv committed Sep 11, 2018
1 parent e2aa687 commit 3d5b9d2
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,17 @@ module.exports = function (userOptions) {
// Add vue-i18n-loader if applicable
if (options.vueI18nLoader) {
this.extendBuild(config => {
config.module.rules.find(el => el.loader === 'vue-loader')
.options.loaders.i18n = '@kazupon/vue-i18n-loader'
const loaders = config.module.rules.find(el => el.loader === 'vue-loader').options.loaders
if (loaders) {
// vue-loader under 15.0.0
loaders.i18n = '@kazupon/vue-i18n-loader'
} else {
// vue-loader after 15.0.0
config.module.rules.push({
resourceQuery: /blockType=i18n/,
loader: '@kazupon/vue-i18n-loader'
})
}
})
}

Expand Down

0 comments on commit 3d5b9d2

Please sign in to comment.