lib/webpack_rails/processor.rb in webpack_rails-1.1.0 vs lib/webpack_rails/processor.rb in webpack_rails-1.1.1
- old
+ new
@@ -28,10 +28,13 @@
file_contents = nil
if self.class.config[:watch]
result = WebpackRails::Task.run_webpack(self.class.config)
- result[:modules].map{|m| context.depend_on m}
+ # add webpack bundle dependencies as sprockets dependencies for this file
+ result[:modules].map do |m|
+ context.depend_on(m) if m.start_with?('/') # ignore non-filepath entries
+ end
file_contents = context.pathname.open.read # reload file contents after build
else
file_contents = data
end