@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
21 lines (17 loc) • 560 B
JavaScript
;
var path = require('node:path');
var readPkgUp = require('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;
};
exports.getModulePath = getModulePath;
//# sourceMappingURL=resolve-module.js.map