Like the title, how to achieve it if possible? The following is the code. The requirement is that it can only be implemented in function foo.
// "/lib/a.js"
export default function foo () {
// code here
return path
}
// "/src/pages/b.js"
import foo from "../../lib/a.js"
let str = foo()
console.log(str) // 成功打印本地文件路径
Please ignore any grammatical errors