From fefa16ceec89f1d878b2d4f98ac106ec5db7108c Mon Sep 17 00:00:00 2001 From: Liu Xinyu Date: Tue, 1 May 2018 08:24:58 -0500 Subject: [PATCH] fix: index file judgement bug (close: #306) (#308) --- lib/prepare.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/prepare.js b/lib/prepare.js index 2d0fc56db2..ce8371b9cd 100644 --- a/lib/prepare.js +++ b/lib/prepare.js @@ -236,7 +236,7 @@ async function genComponentRegistrationFile ({ sourceDir }) { return `import Vue from 'vue'\n` + components.map(genImport).join('\n') } -const indexRE = /\b(index|readme)\.md$/i +const indexRE = /(?<=(^|\/))(index|readme)\.md$/i const extRE = /\.(vue|md)$/ function fileToPath (file) {