refactor: tiny change on filename escape pattern

This commit is contained in:
Clark Du 2018-09-05 16:13:35 +01:00
parent 3ca2f02674
commit 14e608bf43

View File

@ -270,7 +270,7 @@ export default class Builder {
})).forEach((f) => { })).forEach((f) => {
const key = f.replace(/\.(js|vue)$/, '') const key = f.replace(/\.(js|vue)$/, '')
if (/\.vue$/.test(f) || !files[key]) { if (/\.vue$/.test(f) || !files[key]) {
files[key] = f.replace(/(['|"])/g, '\\$1') files[key] = f.replace(/('|")/g, '\\$1')
} }
}) })
templateVars.router.routes = createRoutes( templateVars.router.routes = createRoutes(