fuc-new/doc/node_modules/@vuepress/helper/lib/node/utils/getModulePath.js
hellcat 6adbc04d4b 1
2025-10-03 17:17:08 +08:00

14 lines
445 B
JavaScript

import { fileURLToPath } from 'node:url';
import { path } from 'vuepress/utils';
/**
* Get file path of a given module url
*
* 获取给定模块 URL 的文件路径
*
* @param module - Module name / 模块名称
* @param meta - Import meta object / 导入元数据对象
*
* @returns Normalized file path / 标准化的文件路径
*/
export const getModulePath = (module, meta) => path.normalize(fileURLToPath(meta.resolve(module)));