react_rails_webpack 2.0.5 → 2.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/lib/react_rails_webpack/client/webpack.config.js +16 -6
- data/lib/react_rails_webpack/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 571c5888138f2fb0f6f66cd43088c5fcdb11bd62
|
4
|
+
data.tar.gz: 3b582cfe75e702225543ace2441aaa4b5f0ec12f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12d2845c6f7be8e74a6582f4274f470710388715ae480af636a59b4d7bcfe0a86bfb94b2009bc0d5166d7a64aed37593d04d9f010dcab101af8f106a66830fc4
|
7
|
+
data.tar.gz: 130f543c7a784b34ffce103b5216cfbe1d8979d183d30ffde4cf63da2db68acd80641e25841a911e13299621455e09114dd5a2f3509f12b023209889a8943903
|
data/README.md
CHANGED
@@ -18,9 +18,9 @@ A set of Rails generators that create all the necessary boilerplate code (with e
|
|
18
18
|
|
19
19
|
## Requirements
|
20
20
|
|
21
|
-
- [Rails](http://rubyonrails.org/) version 4 or greater (check version with `rails -v`)
|
22
|
-
- [node](https://nodejs.org) version 4 or greater (check version with `node -v`)
|
23
|
-
- [npm](https://www.npmjs.com/) version 3 or greater (check version with `npm -v`)
|
21
|
+
- **[Rails](http://rubyonrails.org/)** version **4 or greater** (check version with `rails -v`)
|
22
|
+
- **[node](https://nodejs.org)** version **4 or greater** (check version with `node -v`)
|
23
|
+
- **[npm](https://www.npmjs.com/)** version **3 or greater** (check version with `npm -v`)
|
24
24
|
|
25
25
|
## See the demo components in action
|
26
26
|
|
@@ -33,7 +33,7 @@ A set of Rails generators that create all the necessary boilerplate code (with e
|
|
33
33
|
|
34
34
|
1. Generate an example page in rails with the `rails g react_rails_webpack:create_example_page` command
|
35
35
|
2. Start your Rails server with `rails s`
|
36
|
-
3. Go to [localhost:3000/greeting](localhost:3000/greeting)
|
36
|
+
3. Go to [localhost:3000/greeting](http://localhost:3000/greeting)
|
37
37
|
|
38
38
|
## Commands
|
39
39
|
|
@@ -1,11 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
Welcome to the Webpack configuration file!
|
3
|
+
*/
|
4
|
+
|
1
5
|
require('webpack')
|
2
|
-
var getConfig = require('hjs-webpack')
|
6
|
+
var getConfig = require('hjs-webpack') // This setup is largely based on the hjs-webpack npm package
|
3
7
|
var environment = require('./environment.json')
|
4
8
|
|
5
9
|
var config = getConfig({
|
6
|
-
in: 'src/app.js',
|
7
|
-
out: '../app/assets/webpack',
|
8
|
-
minify: false,
|
10
|
+
in: 'src/app.js', // Tells webpack to look in the src/app.js file to find the code for components and rendering
|
11
|
+
out: '../app/assets/webpack', // Tells webpack to put compiled files into ../app/assets/webpack when it runs
|
12
|
+
minify: false, // Tells Webpack not to minify stuff, since in this case we'll let the Rails asset pipeline deal with that
|
9
13
|
html: function (context) {
|
10
14
|
return {
|
11
15
|
'index.html':
|
@@ -14,6 +18,12 @@ var config = getConfig({
|
|
14
18
|
// title: 'Site Title'
|
15
19
|
// head: '<script src="http://code.jquery.com/jquery-2.1.4.min.js"></script>',
|
16
20
|
html: "<aside class='source'>Find the source for this page in client/webpack.config.js</aside>" +
|
21
|
+
|
22
|
+
// The divs below will get detected by React because they have the "react-component-target" class
|
23
|
+
// If you want to test a new component, you'll have to edit one of these accordingly or
|
24
|
+
// add another div with the "react-component-target" class and pass it the appropriate
|
25
|
+
// component name and props in the "data-componentname" and "data-componentprops" attributes
|
26
|
+
// just like the ones below.
|
17
27
|
"<div class=\"react-component-target\" data-componentname=\"Hello\" data-componentprops='{ \"details\": \"My initial greeting was set with getInitialState in the client/src/components/Hello.jsx file.\" }'></div>" +
|
18
28
|
"<div class=\"react-component-target\" data-componentname=\"HelloWithRedux\" data-componentprops='{ \"details\": \"My initial greeting was set with initialState in the client/src/redux/reducer.js file.\" }'></div>"
|
19
29
|
}
|
@@ -22,10 +32,10 @@ var config = getConfig({
|
|
22
32
|
},
|
23
33
|
|
24
34
|
// environment.hostname is set in your environment.json file
|
25
|
-
//
|
35
|
+
// It should be set to your computer's name on your network
|
26
36
|
// On a Mac, to see your computer's name on your network,
|
27
37
|
// go to System Preferences, and then the "Sharing" menu,
|
28
|
-
// and you should see
|
38
|
+
// and you should see it in the "Computer Name" input field
|
29
39
|
hostname: environment.hostname,
|
30
40
|
isDev: process.env.NODE_ENV !== 'production'
|
31
41
|
})
|