webpack-rails-react 1.0.7 → 1.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ab15cc237b848592e2bf33e98d8dae38da3982e3
4
- data.tar.gz: 733ed1de054c198512de0fa2def7580c5352cdaa
3
+ metadata.gz: 0da8cf4f7d6b95ba1a7cb9da36e7404392bb7bd9
4
+ data.tar.gz: 805c1c43baab1db2c655ed4b059b8788df501f5a
5
5
  SHA512:
6
- metadata.gz: 19dbe43e1f8f6368fd5e55c8f3c6191a6ec39d485a495afbd2e36a98525ac8a867febb0f71f0c6b0d2c878d9d7ec6de10a0de4bc7fbb4472149165419c1e6068
7
- data.tar.gz: 10ccac5d9498461ccab3061b4cb27644846408ca0905c46a7b14da5a87d44ec6e39d07bc92c3d1f582543be5edbc39198fe507924e0c8480aaed4a86ee7d545a
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
- 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.
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
- <script src="http://localhost:3808/webpack-dev-server.js"></script>
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
@@ -2,7 +2,7 @@ module Webpack
2
2
  # :nodoc:
3
3
  module Rails
4
4
  module React
5
- VERSION = "1.0.7"
5
+ VERSION = "1.0.8"
6
6
  end
7
7
  end
8
8
  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.7
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-06-10 00:00:00.000000000 Z
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.4.5
84
+ rubygems_version: 2.5.1
85
85
  signing_key:
86
86
  specification_version: 4
87
87
  summary: Webpack / Rails / React