修复后缀为mjs的依赖引入

pull/1/head
yutent 2023-05-30 10:19:41 +08:00
parent 73ff200b87
commit 24a450ffe8
1 changed files with 10 additions and 2 deletions

View File

@ -179,7 +179,11 @@ export function parseJs(
name = name.replace(/^\//, urlJoin(DEPLOY_PATH, ASSETS_DIR))
}
if (!name.endsWith('.js') && !name.endsWith('.vue')) {
if (
!name.endsWith('.js') &&
!name.endsWith('.mjs') &&
!name.endsWith('.vue')
) {
if (name.includes('components')) {
name += '.vue'
} else {
@ -252,7 +256,11 @@ export function parseJs(
name = name.replace(/^\//, urlJoin(DEPLOY_PATH, ASSETS_DIR))
}
if (!name.endsWith('.js') && !name.endsWith('.vue')) {
if (
!name.endsWith('.js') &&
!name.endsWith('.mjs') &&
!name.endsWith('.vue')
) {
name += '.js'
}
}