@strapi/strapi
Version:
An open source headless CMS solution to create and manage your own API. It provides a powerful dashboard and features to make your life easier. Databases supported: MySQL, MariaDB, PostgreSQL, SQLite
19 lines (16 loc) • 527 B
JavaScript
import path from 'node:path';
import readPkgUp from 'read-pkg-up';
/**
* Resolve module to package root for use in aliases.
* Ensures pnpm's strict node_modules structure can resolve packages when bundling plugin chunks.
*
* @internal
*/ const getModulePath = (mod)=>{
const modulePath = require.resolve(mod);
const pkg = readPkgUp.sync({
cwd: path.dirname(modulePath)
});
return pkg ? path.dirname(pkg.path) : modulePath;
};
export { getModulePath };
//# sourceMappingURL=resolve-module.mjs.map