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

Option to select package manager #1746

Closed
jlpereira opened this issue Oct 11, 2018 · 9 comments
Closed

Option to select package manager #1746

jlpereira opened this issue Oct 11, 2018 · 9 comments

Comments

@jlpereira
Copy link

Hi guys,

Is there any intention to implement an option to select the package manager? We prefer to use NPM instead Yarn

@jlpereira jlpereira changed the title Option to package manager Option to select package manager Oct 11, 2018
@jakeNiemiec
Copy link
Member

jakeNiemiec commented Oct 12, 2018

I think it is unlikely. Webpacker was conceived during the npm@5->6 debacle. I am sure that those conceptions are still fresh in the minds of the webpacker maintainers (rightly so). But, it is mostly all better now.

@seanhealy
Copy link

It's not too bad to flip webpacker over to npm. (#1603 (comment))

That being said, an option to use npm out of the box would be very nice. Especially given some of the improvements npm is offering over and above yarn lately.

@NARKOZ
Copy link

NARKOZ commented Nov 17, 2018

It's not too bad to flip webpacker over to npm. (#1603 (comment))

master now explicitly requires for yarn:

@node_modules_bin_path = ENV["WEBPACKER_NODE_MODULES_BIN_PATH"] || `yarn bin`.chomp

@JanStevens
Copy link

Any update on this? We don't like to be forced to use one tool or another, also npm picked up their game. I looked through the source and it doesn't seem that hard to make it configurable or at least allow people to pick between yarn and npm.

Willing to put some time on this if its going to be accepted

@neemzy
Copy link

neemzy commented May 9, 2019

Same here. It honestly makes no sense to vendor-lock yourself in an ecosystem that doesn't even belong to you, and make your users implicitly do the same choice on top of that. We're willing to help implement this too if you guys are on board.

@rwojsznis
Copy link

master now explicitly requires for yarn

Yeah, but you can declare that ENV (this can be a relative path and I will just work)

As for deployment WEBPACKER_PRECOMPILE can be set to false and you will have to write your own compile task to skip webpacker:verify_install step as right now it's not very flexible.

Overall it's doable - personally I'm using webpacker without yarn for over half a year now (dev & prod) - I was against adding yet another dependency on top of the project when npm was already there.

@jakeNiemiec
Copy link
Member

Context behind the yarn decision: #475 (comment) (I don't think it has been linked here)

Webpacker is designed to work primarily with Rails 5.1+ and Rails has picked Yarn for now as the JavaScript packaging approach. That doesn't mean that someone couldn't go another route, but just that what we'll support out the box is Yarn. Now that we've extracted all logic from the tasks and moved them into the Webpacker class, it's trivially easy for someone who'd like to use a different approach to call the logic without relying on the tasks and prechecks we have.

@Shashwat986
Copy link

I don't agree. It really isn't trivially easy to switch package managers. Even if it was made trivially easy, that would work for me as well.

@rossta
Copy link
Member

rossta commented Jan 13, 2021

Thanks for the lively discussion. It doesn't look like there any plans to support alternative package managers for the time being.

@rossta rossta closed this as completed Jan 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants