function getRange(json, name) { if (has(json, name)) { const object = json[name] if (has(object, "esm")) { return validRange(object.esm) } } return null }
has(pkgJSON, "esm")) { optionsFound = true options = pkgJSON.esm
const parseArgs = processArgs => { const args = minimist(processArgs.slice(2)); return { entry: first(args._), esm: !!args.esm }; }
stats.modules.forEach((module) => { const { name, size, reasons } = module; const isEsm = reasons.some((reason) => moduleTypes[reason.type] === 'esm'); const isCjs = reasons.some((reason) => moduleTypes[reason.type] === 'cjs'); const reasonTypes = reasons.map((reason) => ({ name: reason.module, type: reason.type })); const moduleWithTypes = { name, size, reasonTypes, }; if (obj.esm && isEsm && !isCjs) obj.esm.push(moduleWithTypes); else if (obj.both && isEsm && isCjs) obj.both.push(moduleWithTypes); else if (obj.cjs && !isEsm && isCjs) obj.cjs.push(moduleWithTypes); });
this.child.send({ input: input, isfn: isfn, cwd: options.cwd, esm: options.esm });
const totalCount = modules.cjs.length + modules.esm.length + modules.both.length; <div className='content-card'> <div className='tree-module'> <TreeModule list={modules.esm.concat(modules.cjs).concat(modules.both)} title={`Total Modules`} count={totalCount} totalCount={totalCount} /> <TreeModule list={modules.esm} title={`Treeshakable (ESM) Modules`} count={modules.esm.length} totalCount={totalCount} />
var isfn = obj.isfn, input = obj.input, esm = obj.esm, cwd = obj.cwd;
const requireFn = noESM === false ? esm(module) : require; for (const f of files) { const spec = requireFn(path.resolve(process.cwd(), f));
this.child.send({ input: input, isfn: isfn, cwd: options.cwd, esm: options.esm });