diff --git a/lib/common/utils.js b/lib/common/utils.js index 59e3f15c25..710eccf519 100644 --- a/lib/common/utils.js +++ b/lib/common/utils.js @@ -258,7 +258,7 @@ exports.createRoutes = function createRoutes(files, srcDir, pagesDir) { let routes = [] files.forEach(file => { let keys = file - .replace(`/^${pagesDir}/`, '') + .replace(RegExp(`^${pagesDir}`), '') .replace(/\.(vue|js)$/, '') .replace(/\/{2,}/g, '/') .split('/')