Skip to content
This repository has been archived by the owner on Jan 4, 2023. It is now read-only.

Commit

Permalink
fix: handle empty store/middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Feb 27, 2021
1 parent 841e614 commit 0e7c3ae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion templates/middleware.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%
const _middleware = middleware.map(m => ({
const _middleware = ((typeof middleware !== 'undefined' && middleware) || []).map(m => ({
filePath: relativeToBuild(srcDir, dir.middleware, m.src),
id: m.name || m.src.replace(/\.(js|ts)$/, '').replace(/[\.\\/]/g, '_')
}))
Expand Down
2 changes: 1 addition & 1 deletion templates/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import Vue from 'vue'
import Vuex from 'vuex'
<%
const _storeModules = storeModules.map(s => ({
const _storeModules = ((typeof storeModules !== 'undefined' && storeModules) || []).map(s => ({
filePath: relativeToBuild(srcDir, dir.store, s.src),
id: (s.src
.replace(/\.(js|ts)$/, '')
Expand Down

0 comments on commit 0e7c3ae

Please sign in to comment.