webpack-rails-react 1.0.7 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +22 -1
- data/lib/generators/webpack_rails_react/install_generator.rb +3 -1
- data/lib/webpack/rails/react/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0da8cf4f7d6b95ba1a7cb9da36e7404392bb7bd9
|
4
|
+
data.tar.gz: 805c1c43baab1db2c655ed4b059b8788df501f5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b23afced5ca978ba91d38bb3914ee2ad591d4ae33616b052381082410f1043cfe8cf3510968f8a055d60600258bf891c9b4d12077e3179f22e852ef7cc103de8
|
7
|
+
data.tar.gz: f221bbbe50ce4d88c8f8991d1c29eb52d8a7c73c959ef678c79d0f3f079d69888387723a4f0e80acc854c2d5c2bd812c0f89577b7fc260bd981e5affcb7822fe
|
data/README.md
CHANGED
@@ -65,7 +65,28 @@ In CI, we manually run `webpack` to compile the assets to public and set `config
|
|
65
65
|
|
66
66
|
### Production Deployment
|
67
67
|
|
68
|
-
|
68
|
+
If deploying to heroku, you will need to set your buildpacks before pushing. After adding the heroku git remote, run the below three commands:
|
69
|
+
|
70
|
+
```
|
71
|
+
heroku buildpacks:clear
|
72
|
+
heroku buildpacks:set heroku/nodejs
|
73
|
+
heroku buildpacks:add heroku/ruby --index 2
|
74
|
+
```
|
75
|
+
|
76
|
+
This will set the Node.js buildpack to run first, followed by the Ruby buildpack. To confirm that your buildpacks are set correctly, run `heroku buildpacks`. You should see Node.js listed first and Ruby second.
|
77
|
+
|
78
|
+
Next you will need to set up a post build hook to bundle Webpack. Include the below scripts in `package.json`. For the Webpack deployment script, ensure that the route for your `webpack.config.js` file is correct.
|
79
|
+
|
80
|
+
``` javascript
|
81
|
+
"scripts": {
|
82
|
+
"webpack:deploy": "webpack --config=config/webpack.config.js -p",
|
83
|
+
"heroku-postbuild": "npm run webpack:deploy"
|
84
|
+
}
|
85
|
+
```
|
86
|
+
|
87
|
+
Lastly, ensure that all Babel related modules are listed as dependencies and not dev dependencies in `package.json`. At this point, you should be able to push to Heroku.
|
88
|
+
|
89
|
+
An alternative to adding the post build hook to `package.json` is to add `rake webpack:compile` to your deployment. It serves a similar purpose as Sprockets' `assets:precompile` task. If you're using Webpack and Sprockets (as we are at Marketplacer) you'll need to run both tasks - but it doesn't matter which order they're run in.
|
69
90
|
|
70
91
|
If you're using `[chunkhash]` in your build asset filenames (which you should be, if you want to cache them in production), you'll need to persist built assets between deployments. Consider in-flight requests at the time of deployment: they'll receive paths based on the old `manifest.json`, not the new one.
|
71
92
|
|
@@ -89,7 +89,9 @@ module WebpackRailsReact
|
|
89
89
|
end
|
90
90
|
insert_into_file 'app/views/layouts/application.html.erb', before: /<\/head>/ do
|
91
91
|
<<-'RUBY'
|
92
|
-
|
92
|
+
<% if Rails.env.development? %>
|
93
|
+
<script src="http://localhost:3808/webpack-dev-server.js"></script>
|
94
|
+
<% end %>
|
93
95
|
RUBY
|
94
96
|
end
|
95
97
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webpack-rails-react
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dave Jungst
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-07-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -81,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
81
81
|
version: '0'
|
82
82
|
requirements: []
|
83
83
|
rubyforge_project:
|
84
|
-
rubygems_version: 2.
|
84
|
+
rubygems_version: 2.5.1
|
85
85
|
signing_key:
|
86
86
|
specification_version: 4
|
87
87
|
summary: Webpack / Rails / React
|