优化数据,增加默认的插件前缀
This commit is contained in:
@@ -17,10 +17,16 @@ export default defineEventHandler(async (event) => {
|
||||
|
||||
try {
|
||||
// Nuxt buildDir 是 .nuxt
|
||||
const manifestPath = join(process.cwd(), "public/generated/manifest.js");
|
||||
let manifestPath = join(process.cwd(), "public/generated/manifest.js");
|
||||
|
||||
// 检查文件是否存在
|
||||
await fs.access(manifestPath);
|
||||
try {
|
||||
await fs.access(manifestPath);
|
||||
} catch {
|
||||
// fallback 到 .output/public
|
||||
manifestPath = join(process.cwd(), ".output/public/generated/manifest.js");
|
||||
await fs.access(manifestPath);
|
||||
}
|
||||
|
||||
// 动态导入
|
||||
const { manifestInfo } = await import(manifestPath);
|
||||
|
||||
Reference in New Issue
Block a user