Skip to content

Commit 1dfd8c7

Browse files
authored
Merge pull request shakacode#303 from shakacode/convert-buildpacks-for-heroku
Change from .buildpacks file
2 parents 76635c4 + 3ed34a7 commit 1dfd8c7

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

.buildpacks

Lines changed: 0 additions & 3 deletions
This file was deleted.

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,12 @@ Save a change to a JSX file and see it update immediately in the browser! Note,
113113
We're now using Webpack for all Sass and JavaScript assets so we can do CSS Modules within Rails!
114114

115115
1. **Production Deployment**: We previously had create a file `lib/tasks/assets.rake` to modify the Rails precompile task to deploy assets for production. However, we add this automatically in newer versions of React on Rails. If you need to customize this file, see [lib/tasks/assets.rake from React on Rails](https://github.com/shakacode/react_on_rails/blob/master/lib/tasks/assets.rake) as an example as well as the doc file: [heroku-deployment.md](https://github.com/shakacode/react_on_rails/blob/master/docs/additional-reading/heroku-deployment.md).
116+
1. Configure Buildpacks
117+
```
118+
heroku buildpacks:set heroku/ruby --app your-app
119+
heroku buildpacks:add --index 1 heroku/nodejs --app your-app
120+
heroku buildpacks:add --index 3 https://github.com/sreid/heroku-buildpack-sourceversion --app your-app
121+
```
116122
1. **Development Mode**: Two flavors: Hot reloading assets (JavaScript & CSS) and Static loading.
117123
1. **Hot Loading**: We modify the URL in [application.html.erb](app/views/layouts/application.html.erb) based on whether or not we're in production mode using the helpers `env_stylesheet_link_tag` and `env_javascript_include_tag`. *Development mode* uses the Webpack Dev server running on port 3500. Other modes (production/test) use precompiled files. See `Procfile.hot`. `Procfile.dev` also starts this mode. Note, *you don't have to refresh a Rails web page to view changes to JavaScript or CSS*.
118124
2. **Static Loading**: This uses webpack to create physical files of the assets, both JavaScript and CSS. This is essentially what we had before we enabled *Hot Loading*. You have to *refresh* the page to see changes to JavaScript or CSS. See `Procfile.static`. It is important to note that tests will use the same statically generated files.

0 commit comments

Comments
 (0)