Skip to content

Commit

Permalink
fix: crash registering the vue-i18n-loader in old Node versions
Browse files Browse the repository at this point in the history
Don't use new ES features in the module.
  • Loading branch information
rchl committed Mar 26, 2021
1 parent 075309e commit 43022c4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/core/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ export function buildHook (options) {
// Add vue-i18n-loader if applicable
if (options.vueI18nLoader) {
this.extendBuild(config => {
config.module?.rules.push({
if (!config.module) {
console.warn(formatMessage('Failed to register the vue-i18n-loader.'))
return
}
config.module.rules.push({
resourceQuery: /blockType=i18n/,
type: 'javascript/auto',
loader: require.resolve('@intlify/vue-i18n-loader')
Expand Down

0 comments on commit 43022c4

Please sign in to comment.