webpack-assets 0.3.1 → 0.3.2
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 +2 -2
- data/lib/webpack.rb +4 -0
- data/lib/webpack/assets/version.rb +1 -1
- data/lib/webpack/view_helpers.rb +11 -6
- 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: 0cb14b7a8b81ab6a047e5e0b2570156529551fa3
|
4
|
+
data.tar.gz: f296dd39284bb066dd4175bab85c7d6d7676a496
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bfc0762e61db53659c6a783c513be37e668ac34e8ded0654fbfc0ca632dbd55a8b6289cef626a311b5a4e7a95b8b963f060766370674b9805896ffdb7dda08b0
|
7
|
+
data.tar.gz: 92e02b9b493ca80612cf8e68d87153e34adeec5c87068ad35a0a2685712349fe8f58ef975d14983d9c63195d0a8d08731c0437d5904fd1e4cd4c1308dc7c7e4c
|
data/README.md
CHANGED
@@ -49,6 +49,8 @@ Optional settings:
|
|
49
49
|
|
50
50
|
- `host` - the host with the port webpack dev server is running on (can be used instead of `port` option).
|
51
51
|
|
52
|
+
- `cdn_host` - the CDN host (will be prepended to URLs for all files).
|
53
|
+
|
52
54
|
Example usage:
|
53
55
|
|
54
56
|
```ruby
|
@@ -61,8 +63,6 @@ Optional settings:
|
|
61
63
|
end
|
62
64
|
```
|
63
65
|
|
64
|
-
- `cdn_host` - the CDN host (used only in `webpack_static_file_url` for now).
|
65
|
-
|
66
66
|
View helpers:
|
67
67
|
|
68
68
|
- `webpack_js_tag` is a replacement for `javascript_include_tag`.
|
data/lib/webpack.rb
CHANGED
data/lib/webpack/view_helpers.rb
CHANGED
@@ -38,7 +38,8 @@ module Webpack
|
|
38
38
|
if Webpack.config.use_server
|
39
39
|
server_url("#{name}.#{ext}")
|
40
40
|
else
|
41
|
-
Webpack.fetch_entry(name.to_s, ext.to_s)
|
41
|
+
entry = Webpack.fetch_entry(name.to_s, ext.to_s)
|
42
|
+
full_url(entry)
|
42
43
|
end
|
43
44
|
end
|
44
45
|
|
@@ -47,16 +48,20 @@ module Webpack
|
|
47
48
|
server_url(path)
|
48
49
|
else
|
49
50
|
static_file = Webpack.fetch_static_file("#{Webpack.config.static_path}/#{path}")
|
50
|
-
|
51
|
-
"#{protocol}#{Webpack.config.cdn_host}#{static_file}"
|
52
|
-
else
|
53
|
-
static_file
|
54
|
-
end
|
51
|
+
full_url(static_file)
|
55
52
|
end
|
56
53
|
end
|
57
54
|
|
58
55
|
private
|
59
56
|
|
57
|
+
def full_url(path)
|
58
|
+
if Webpack.config.cdn_host.present?
|
59
|
+
[protocol, Webpack.config.cdn_host, path].join
|
60
|
+
else
|
61
|
+
path
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
60
65
|
def server_url(path)
|
61
66
|
"#{protocol}#{server_host}#{Webpack.config.public_path}/#{path}"
|
62
67
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webpack-assets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergey Nartimov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|
@@ -124,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
124
124
|
version: '0'
|
125
125
|
requirements: []
|
126
126
|
rubyforge_project:
|
127
|
-
rubygems_version: 2.
|
127
|
+
rubygems_version: 2.6.12
|
128
128
|
signing_key:
|
129
129
|
specification_version: 4
|
130
130
|
summary: Webpack Assets for Rails.
|