Skip to content

Commit

Permalink
Support spring (#221)
Browse files Browse the repository at this point in the history
  • Loading branch information
gauravtiwari authored and dhh committed Apr 4, 2017
1 parent 9d4cb99 commit 98691d8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
5 changes: 5 additions & 0 deletions lib/webpacker.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
module Webpacker
def self.bootstrap
Webpacker::Env.load
Webpacker::Configuration.load
Webpacker::Manifest.load
end
end

require "webpacker/railtie" if defined?(Rails)
9 changes: 2 additions & 7 deletions lib/webpacker/railtie.rb
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
require "rails/railtie"

require "webpacker/helper"
require "webpacker/env"

class Webpacker::Engine < ::Rails::Engine
initializer :webpacker do |app|
ActiveSupport.on_load :action_controller do
ActionController::Base.helper Webpacker::Helper
end

# Determine NODE_ENV environment based on config/webpack/paths.yml
Webpacker::Env.load
# Loads webpacker config data from config/webpack/paths.yml
Webpacker::Configuration.load
# Loads manifest data from public/packs/manifest.json
Webpacker::Manifest.load
Webpacker.bootstrap
Spring.after_fork { Webpacker.bootstrap } if defined?(Spring)
end
end

0 comments on commit 98691d8

Please sign in to comment.