const JoyCon = require('joycon')const joycon = new JoyCon()joycon.load(['package-lock.json', 'yarn.lock']).then(result => { // result is {} when files do not exist // otherwise { path, data }})
By default, non-js files are parsed as JSON, if you want something different you can add a loader:
Joycon is used to resolve the tsup.config.ts. That’s how your tsup configuration is loaded.
Based on the config path, if it ends with .json, loadJson function is called as shown below:
if (configPath) { if (configPath.endsWith('.json')) { let data = await loadJson(configPath) if (configPath.endsWith('package.json')) { data = data.tsup } if (data) { return { path: configPath, data } } return {}}