Skip to content

In README, better highlight how to add Webpacker to an existing app #399

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

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,23 @@ that's been made default from that version forward.
Webpacker is currently compatible with Rails 4.2+, but there's no guarantee it will still be
in the future.

You can either make use of Webpacker during setup of a new application with `--webpack`
or you can add the gem and run `./bin/rails webpacker:install` in an existing application.
### Enable Webpacker for a new app

As the rubygems version isn't promised to be kept up to date until the release of Rails 5.1, you may want to include the gem directly from GitHub:
To add Webpacker to a newly created app, add the `--webpack` option when creating the app:

```ruby
gem 'webpacker', github: 'rails/webpacker'
```
rails new your-app-name --webpack
```

### Add Webpacker to an existing app

To add Webpacker to an existing app, first add the gem to your Gemfile:

```rb
gem 'webpacker'
```

You can also see a list of available commands by running `./bin/rails webpacker`
Then run `bundle install` to install the gem. Then run `./bin/rails webpacker:install` to configure your application to use Webpacker. You can also see a list of available commands by running `./bin/rails webpacker`

## Binstubs

Expand Down