MCPcopy Index your code
hub / github.com/rollup/plugins / getPackageEntryPoint

Function getPackageEntryPoint

packages/commonjs/src/dynamic-modules.js:10–24  ·  view source on GitHub ↗
(dirPath)

Source from the content-addressed store, hash-verified

8import { getVirtualPathForDynamicRequirePath, normalizePathSlashes } from './utils';
9
10function getPackageEntryPoint(dirPath) {
11 let entryPoint = 'index.js';
12
13 try {
14 if (existsSync(join(dirPath, 'package.json'))) {
15 entryPoint =
16 JSON.parse(readFileSync(join(dirPath, 'package.json'), { encoding: 'utf8' })).main ||
17 entryPoint;
18 }
19 } catch (ignored) {
20 // ignored
21 }
22
23 return entryPoint;
24}
25
26function isDirectory(path) {
27 try {

Callers 1

getDynamicRequireModulesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected