webpack_integration 0.1.0 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -2
- data/lib/webpack_integration/railtie.rb +15 -0
- data/lib/webpack_integration/version.rb +1 -1
- data/lib/webpack_integration/view_helper.rb +1 -1
- data/lib/webpack_integration.rb +4 -2
- 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: 93cb36d7863ef6808b0190088c5f69f3e23bf1fe
|
4
|
+
data.tar.gz: 965302b59b3a522a7d900f6055f074b16a49721e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5742ea0bdf585a9f01f38ab184434ea313a21b48189b4971f112e48b50af8b1297b3275b24bd00402af6b1a278a245de6ea8e33cc8ba238cbd64b1a408947c0d
|
7
|
+
data.tar.gz: 65aaf5902ba5a3e129d620d6d165d0d47298c0c6d237a395bcb3ef87788e615e17a985cccfc6a6f9622f2138d3c52dc1a0c0d7e4e56b02d1631baa542f9f8fdb
|
data/README.md
CHANGED
@@ -15,7 +15,7 @@ Example:
|
|
15
15
|
public/webpack/invoices_view_styles-bundle-0ebe2ec.js
|
16
16
|
|
17
17
|
|
18
|
-
Refer to files in Rails views by
|
18
|
+
Refer to files in Rails views by `webpack_file`:
|
19
19
|
|
20
20
|
<%= javascript_include_tag webpack_file('reports_view_bundle') %>
|
21
21
|
<%= javascript_include_tag webpack_file('reports_view_styles-bundle') %>
|
@@ -44,7 +44,6 @@ Or anywhere in code by:
|
|
44
44
|
WebpackIntegration.configure do |config|
|
45
45
|
config.public_folder = 'public' # default 'public'
|
46
46
|
config.folder_in_public = 'webpack' # default 'webpack'
|
47
|
-
config.reset_on_each_request = Rails.env.development? # default false
|
48
47
|
end
|
49
48
|
|
50
49
|
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module WebpackIntegration
|
2
|
+
class Railtie < Rails::Railtie
|
3
|
+
initializer "webpack_integration.configure_rails_initialization" do |app|
|
4
|
+
ActiveSupport.on_load :action_view do
|
5
|
+
include WebpackIntegration::ViewHelper
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
# Add a to_prepare block which is executed once in production
|
10
|
+
# and before each request in development
|
11
|
+
config.to_prepare do
|
12
|
+
WebpackIntegration.reset_assets_manifest!
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/lib/webpack_integration.rb
CHANGED
@@ -2,8 +2,10 @@ require "webpack_integration/version"
|
|
2
2
|
require "webpack_integration/configuration"
|
3
3
|
require "webpack_integration/assets"
|
4
4
|
require "webpack_integration/store"
|
5
|
-
|
6
|
-
|
5
|
+
if defined?(Rails)
|
6
|
+
require "webpack_integration/railtie"
|
7
|
+
require "webpack_integration/view_helper"
|
8
|
+
end
|
7
9
|
|
8
10
|
module WebpackIntegration
|
9
11
|
def self.configure
|