UNPKG

st-bundle

Version:

CLI for watching and bundling SpringType projects.

23 lines (22 loc) 787 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function getFolderEntryPointFromPackageJSON(props) { if (isBrowserEntry(props.json, props.isBrowserBuild)) { return props.json.browser; } if (props.useLocalField && props.json['local:main']) { return props.json['local:main']; } if (props.json['ts:main']) { return props.json['ts:main']; } if (props.json.module) { return props.json.module; } return props.json.main || 'index.js'; } exports.getFolderEntryPointFromPackageJSON = getFolderEntryPointFromPackageJSON; function isBrowserEntry(json, isBrowserBuild) { return json.browser && isBrowserBuild === true && typeof json.browser === 'string'; } exports.isBrowserEntry = isBrowserEntry;