webpack_stats 1.0.1 → 1.0.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/lib/webpack_stats.rb +15 -10
- 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: 476c287a597979cac309b55344a0f476f9b0b168
|
4
|
+
data.tar.gz: 3ebc2d616d3cd7acbab52163ac72ab9c0d9a05c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed395086675f965c920e6f9f00ee392c9d909233a13eddc444b63ca2ab7dce8c130dfaa5e9dfcdc19961eff63dd00cfccb6cd49366850e30c21780e523b48289
|
7
|
+
data.tar.gz: b99862ade978a7adf167ac8ebd8acde35cdd3ab52ab0e5c3b32a4f7433e42959b5f91b9fe44de8565e9474b360390f0d01ea23a26ef3977f621022cb8fe0f763
|
data/lib/webpack_stats.rb
CHANGED
@@ -4,8 +4,8 @@ require 'json'
|
|
4
4
|
module WebpackStats
|
5
5
|
REGEXP = /(.+?)(?:-([0-9a-f]{20,}))?\.(\w+)/
|
6
6
|
|
7
|
-
@reload =
|
8
|
-
@stats_path =
|
7
|
+
@reload = true
|
8
|
+
@stats_path = 'stats.json'
|
9
9
|
|
10
10
|
class << self
|
11
11
|
attr_accessor :reload, :stats_path, :splitter
|
@@ -47,18 +47,23 @@ module WebpackStats
|
|
47
47
|
|
48
48
|
end
|
49
49
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
WebpackStats.assets[source] || super
|
54
|
-
end
|
50
|
+
module Helper
|
51
|
+
def compute_asset_path source, options = {}
|
52
|
+
WebpackStats.assets[source] || super
|
55
53
|
end
|
56
54
|
end
|
57
|
-
|
58
55
|
end
|
59
56
|
|
60
|
-
|
57
|
+
begin
|
58
|
+
require 'active_support'
|
61
59
|
ActiveSupport.on_load(:action_view) do
|
62
60
|
include WebpackStats::Helper
|
63
61
|
end
|
64
|
-
|
62
|
+
|
63
|
+
ActiveSupport.on_load(:after_initialize) do
|
64
|
+
WebpackStats.configure do |config|
|
65
|
+
config.reload = Rails.env.production? ? false : true
|
66
|
+
config.stats_path = Rails.root.join('stats.json')
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|