Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yarn-plugin-nolyfill: nolyfill your dependencies on install #42

Open
wojtekmaj opened this issue Oct 25, 2023 · 3 comments
Open

yarn-plugin-nolyfill: nolyfill your dependencies on install #42

wojtekmaj opened this issue Oct 25, 2023 · 3 comments

Comments

@wojtekmaj
Copy link

wojtekmaj commented Oct 25, 2023

Hello!

I think I found a better way for nolyfill to work with Yarn. Rather than parsing lockfiles, looking for the dependencies to replace, pollute your package.json, and perhaps more importantly, repeat the process after every time dependencies change, why not let Yarn do all the work?

Here's where Yarn Plugins come in. They allow you to hook into Yarn's dependency resolution process and modify it. I built a plugin to replace certain dependencies with their nolyfill equivalents.

How to use it:

  • Install by executing yarn plugin import https://raw.githubusercontent.com/wojtekmaj/yarn-plugin-nolyfill/v1.0.1/bundles/@yarnpkg/plugin-nolyfill.js.
  • Reinstall repository by executing yarn.
  • Poof! ✨
    12 packages were added to the project, and 57 were removed (- 1.57 MiB).
    

You're more than welcome to try it out and let me know what you think.

See source code: https://github.com/wojtekmaj/yarn-plugin-nolyfill/

@SukkaW
Copy link
Owner

SukkaW commented Oct 26, 2023

@wojtekmaj That's great!

I am also planning on creating something similar with https://pnpm.io/pnpmfile.

@SukkaW SukkaW pinned this issue Dec 11, 2023
@JounQin
Copy link

JounQin commented Jan 6, 2024

The latest plugin import command is yarn plugin import https://raw.githubusercontent.com/wojtekmaj/yarn-plugin-nolyfill/v0.1.1/bundles/@yarnpkg/plugin-nolyfill.js now while I don't quite follow why.

@JounQin
Copy link

JounQin commented Jan 6, 2024

#20 should be elevated in priority for reusing nolyfill data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants