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

Function getMainFields

packages/node-resolve/src/util.js:26–40  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

24}
25
26export function getMainFields(options) {
27 let mainFields;
28 if (options.mainFields) {
29 ({ mainFields } = options);
30 } else {
31 mainFields = ['module', 'main'];
32 }
33 if (options.browser && mainFields.indexOf('browser') === -1) {
34 return ['browser'].concat(mainFields);
35 }
36 if (!mainFields.length) {
37 throw new Error('Please ensure at least one `mainFields` value is specified');
38 }
39 return mainFields;
40}
41
42export function getPackageInfo(options) {
43 const {

Callers 1

nodeResolveFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected