From 95ae7e8932869839b464e3524cc1b8ecf6660a16 Mon Sep 17 00:00:00 2001 From: Gaurav Tiwari Date: Sun, 2 Apr 2017 11:41:21 +0100 Subject: [PATCH] Support spring --- lib/webpacker.rb | 5 +++++ lib/webpacker/railtie.rb | 9 ++------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/webpacker.rb b/lib/webpacker.rb index 7ae894239..2e43bdc37 100644 --- a/lib/webpacker.rb +++ b/lib/webpacker.rb @@ -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) diff --git a/lib/webpacker/railtie.rb b/lib/webpacker/railtie.rb index 2bcd5afc0..07b412a3d 100644 --- a/lib/webpacker/railtie.rb +++ b/lib/webpacker/railtie.rb @@ -1,7 +1,6 @@ require "rails/railtie" require "webpacker/helper" -require "webpacker/env" class Webpacker::Engine < ::Rails::Engine initializer :webpacker do |app| @@ -9,11 +8,7 @@ class Webpacker::Engine < ::Rails::Engine 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