webpack-rails 0.9.6 → 0.9.7
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 +7 -0
- data/lib/webpack/rails/helper.rb +3 -1
- data/lib/webpack/rails/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3be54a13fb6e00927655f4ac50ef87cde665ff1
|
4
|
+
data.tar.gz: e8e408c0cd2964b1d94b8daba3bcf6686aae10bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a43f41e7f1cacdbf08805a8fe4329610f41a47d97743538fe84e20c95354f59b24fc335d2189958cc058f3a16dcdfd8a6c1c04db4e1cf86a2c2cea0661e6e83
|
7
|
+
data.tar.gz: 2db5c1a63ba3c9c2c49a02f9b93657da9df993336e9d93803fff2ee8e488bed078d99590db6306630b1e9c99f45d1b480caab5928b12e5f60515a7672ccaaf42
|
data/README.md
CHANGED
@@ -38,6 +38,13 @@ To add your webpacked javascript in to your app, add the following to the `<head
|
|
38
38
|
|
39
39
|
Take note of the splat (`*`): `webpack_asset_paths` returns an array, as one entry point can map to multiple paths, especially if hot reloading is enabled in Webpack.
|
40
40
|
|
41
|
+
If your webpack is configured to output both CSS and JS, you can use the `extension:` argument to filter which files are returned by the helper:
|
42
|
+
|
43
|
+
```erb
|
44
|
+
<%= javascript_include_tag *webpack_asset_paths('application', extension: 'js') %>
|
45
|
+
<%= stylesheet_link_tag *webpack_asset_paths('application', extension: 'css') %>
|
46
|
+
```
|
47
|
+
|
41
48
|
#### Use with webpack-dev-server live reload
|
42
49
|
|
43
50
|
If you're using the webpack dev server's live reload feature (not the React hot reloader), you'll also need to include the following in your layout template:
|
data/lib/webpack/rails/helper.rb
CHANGED
@@ -12,10 +12,12 @@ module Webpack
|
|
12
12
|
#
|
13
13
|
# Will raise an error if our manifest can't be found or the entry point does
|
14
14
|
# not exist.
|
15
|
-
def webpack_asset_paths(source)
|
15
|
+
def webpack_asset_paths(source, extension: nil)
|
16
16
|
return "" unless source.present?
|
17
17
|
|
18
18
|
paths = Webpack::Rails::Manifest.asset_paths(source)
|
19
|
+
paths = paths.select {|p| p.ends_with? ".#{extension}" } if extension
|
20
|
+
|
19
21
|
host = ::Rails.configuration.webpack.dev_server.host
|
20
22
|
port = ::Rails.configuration.webpack.dev_server.port
|
21
23
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webpack-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Pearson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -59,7 +59,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
59
59
|
requirements:
|
60
60
|
- - ">="
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version:
|
62
|
+
version: 2.0.0
|
63
63
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
65
|
- - ">="
|
@@ -67,7 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
67
67
|
version: '0'
|
68
68
|
requirements: []
|
69
69
|
rubyforge_project:
|
70
|
-
rubygems_version: 2.
|
70
|
+
rubygems_version: 2.5.1
|
71
71
|
signing_key:
|
72
72
|
specification_version: 4
|
73
73
|
summary: Webpack & Rails integration made easier
|