webpack_integration 0.1.0 → 0.1.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d8137d2b6f8d3b7eb9d0a579a568b8acd9d37b95
4
- data.tar.gz: dd62598a0b54960ca81d18c367e871f1ccfd039c
3
+ metadata.gz: 93cb36d7863ef6808b0190088c5f69f3e23bf1fe
4
+ data.tar.gz: 965302b59b3a522a7d900f6055f074b16a49721e
5
5
  SHA512:
6
- metadata.gz: 0fd05c93fbb4e2da52ad6e947a9ee52766ea95f9eedbf80b1c417baf1b0f7870e76846768a77c693060a302be2b3421fa879c448b95ca8771180d62addf6e642
7
- data.tar.gz: 5e4039d724bf2cc8c0612c0cb97bb9ed90188f5f781eda018e73720e6006fe141c677fd0e1aada626caf8ee29073b88e0ac6adf700377b993f1b9a7df1ed9df4
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
@@ -1,3 +1,3 @@
1
1
  module WebpackIntegration
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.5"
3
3
  end
@@ -1,7 +1,7 @@
1
1
  module WebpackIntegration
2
2
  module ViewHelper
3
3
  def webpack_file(filename)
4
- WebpackIntergration.fuzzy_file_for(filename)
4
+ WebpackIntegration.fuzzy_file_for(filename)
5
5
  end
6
6
  end
7
7
  end
@@ -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
- require "webpack_integration/railtie" if defined?(Rails)
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webpack_integration
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roman Heinrich