路径解析
import-meta-resolve 的 CJS
版本,可供不支持 ESM
的项目使用。
如何使用
安装
bash
pnpm add @plugin-light/import-meta-resolve -D
使用
js
import { resolve } from '@plugin-light/import-meta-resolve';
console.log(resolve('./index.js', import.meta.url))