yarnpkg / berry

📦🐈 Active development trunk for Yarn ⚒
https://yarnpkg.com
BSD 2-Clause "Simplified" License
7.37k stars 1.1k forks source link

[Feature] Support yarn.config.mjs #6318

Open latin-1 opened 3 months ago

latin-1 commented 3 months ago

Describe the user story

ESM is the future.

Describe the solution you'd like

Add support for yarn.config.js (the behavior depends on the type field in package.json) and yarn.config.mjs.

Describe the drawbacks of your solution

None

Describe alternatives you've considered

None

HigherOrderLogic commented 2 weeks ago

It'd also be nice to add support for loading .ts file. There's library like jiti and importx that can help with implementing this feature.

clemyan commented 2 weeks ago

@HigherOrderLogic jiti's bundle size is 1.8MB which is prohibitively expensive for just allowing the yarn.config.ts filename, given that you can already typecheck yarn.config.cjs now using @yarnpkg/types and/or JSDoc.