Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support spring #221

Merged
merged 1 commit into from
Apr 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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