Skip to content

Commit

Permalink
Merge pull request #1 from IKuijer/master
Browse files Browse the repository at this point in the history
Added support for index.vue files as component
  • Loading branch information
acidjazz committed May 7, 2021
2 parents 54b33ca + 0217fe3 commit 68f3218
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ export default function stormModule (moduleOptions) {
name = file.match(/components\/(.*?).vue$/)[1].replace(/\//g, '')
} else {
name = file.match(/(\w*)\.vue$/)[1]
// If file is an index.vue file, use folder name instead
if (name === 'index') {
name = file.replace('/index.vue', '').split('/').reverse()[0]
}
}
count++
return { name, file }
Expand Down

0 comments on commit 68f3218

Please sign in to comment.