-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Make executables local #1286
Make executables local #1286
Conversation
Replaces previous behavior of installing from bundle binstubs which rely on globally installed executables that shadowed npm packages by the same names.
@@ -1,7 +1,7 @@ | |||
namespace :webpacker do | |||
desc "Verifies that webpack & webpack-dev-server are present." | |||
task :check_binstubs do | |||
unless Bundler.which(Gem.win_platform? ? "webpack.bat" : "webpack") | |||
unless File.exist?("bin/webpack") && File.exist?("bin/webpack-dev-server") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rossta I think it's fine to leave out check for dev server since people might like to .gitignore it for production.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, right, I was reverting to older behavior.
Thanks for the PR, looks great. There are couple of places we need to replace |
@gauravtiwari I can update those references if you'd prefer them to use |
Ahh right but getting this: (cached executable call)
which makes sense because we have removed the executables from gemspec so bundler has no way to know that an executable exists, no? If I remove the file, then running the same command gives,
Note: I have copied over new binstubs in the |
@gauravtiwari I forgot that I'm using the technique described here to add the local bin directory to |
Thanks for the update - the last bit is prefixing all the ./bin/webpack or dev server calls (if any) with Open3.capture3(webpack_env, "#{RbConfig.ruby} ./bin/webpack") |
@gauravtiwari Good call. I believe the only functional usage is the one I just updated. |
Looks good. Thanks @rossta 🍰 👍 |
Fixes #1281
Potentially breaking change as previously installed binstubs may be referencing a gem executable that may not be installed on the machine. Developers should re-run the install task to update their binstubs. They may also want to uninstall and reinstall the gem to remove the gem executables from their machines.