修复文件目录名和页面名字相同时逻辑处理错误的bug
parent
472aa4d116
commit
99a5fac97d
|
@ -164,7 +164,8 @@ export default async function createServer(root = '', conf = {}) {
|
||||||
let file
|
let file
|
||||||
|
|
||||||
if (IS_MPA) {
|
if (IS_MPA) {
|
||||||
if (rpath.startsWith(currentPage)) {
|
// 判断前后2个值相等, 避免出现目录名和页面名字相同时走错逻辑
|
||||||
|
if (rpath === pathname && rpath.startsWith(currentPage)) {
|
||||||
file = join(pagesDir, rpath.slice(currentPage.length))
|
file = join(pagesDir, rpath.slice(currentPage.length))
|
||||||
} else {
|
} else {
|
||||||
file = join(SOURCE_DIR, rpath)
|
file = join(SOURCE_DIR, rpath)
|
||||||
|
@ -217,7 +218,8 @@ export default async function createServer(root = '', conf = {}) {
|
||||||
let file
|
let file
|
||||||
|
|
||||||
if (IS_MPA) {
|
if (IS_MPA) {
|
||||||
if (rpath.startsWith(currentPage)) {
|
// 判断前后2个值相等, 避免出现目录名和页面名字相同时走错逻辑
|
||||||
|
if (rpath === pathname && rpath.startsWith(currentPage)) {
|
||||||
file = join(pagesDir, rpath.slice(currentPage.length))
|
file = join(pagesDir, rpath.slice(currentPage.length))
|
||||||
} else {
|
} else {
|
||||||
file = join(SOURCE_DIR, rpath)
|
file = join(SOURCE_DIR, rpath)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "fite",
|
"name": "fite",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "0.9.2",
|
"version": "0.9.3",
|
||||||
"bin": {
|
"bin": {
|
||||||
"fite": "index.js"
|
"fite": "index.js"
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue