rs-webpack-rails 0.11.0 → 0.11.1
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/lib/webpack/rails/helper.rb +12 -7
- data/lib/webpack/rails/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f959ffef73a53fe22da1c6d10d9b89d293236a1379ad77ba5c598992732ae84b
|
4
|
+
data.tar.gz: 6f7b4e061c3a1d99759cef48899247d40d8dd2d1c4910a8c8cd1b25a17dad3a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 224115b2906d33fccc51507edc87be053878c3f9aed68da29c9eb8a3d00c7a14535523923a8834088ad517dd371f28d78e9f43c41cd12f9f4b0c1fa7d1263326
|
7
|
+
data.tar.gz: 3422584897090cb0209dfd7e7278217c974e7a0f2879b372408ced840f1e263c72b57ec3278a214f18af55304f367e3bea8e39c930ef06edba38e352d1991579
|
data/lib/webpack/rails/helper.rb
CHANGED
@@ -12,15 +12,20 @@ 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, extension: nil)
|
15
|
+
def webpack_asset_paths(source, extension: nil, ignore_missing: false)
|
16
16
|
return "" unless source.present?
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
18
|
+
begin
|
19
|
+
if ::Rails.configuration.webpack.manifest_type == "manifest"
|
20
|
+
extension = "js" if extension.nil?
|
21
|
+
paths = Webpack::Rails::Manifest.manifest_asset_paths(source + "." + extension)
|
22
|
+
elsif ::Rails.configuration.webpack.manifest_type == "stats"
|
23
|
+
paths = Webpack::Rails::Manifest.asset_paths(source)
|
24
|
+
paths = paths.select { |p| p.ends_with? ".#{extension}" } if extension
|
25
|
+
end
|
26
|
+
rescue Webpack::Rails::Manifest::EntryPointMissingError => e
|
27
|
+
# puts "webpack asset missing in manifest: #{source}"
|
28
|
+
raise e unless ignore_missing
|
24
29
|
end
|
25
30
|
|
26
31
|
port = ::Rails.configuration.webpack.dev_server.port
|