Skip to content

Commit

Permalink
Check for webpacker.yml before setting source (#2366)
Browse files Browse the repository at this point in the history
  • Loading branch information
gauravtiwari committed Nov 12, 2019
1 parent f36e5ed commit 93152cf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/webpacker/env.rb
Expand Up @@ -12,7 +12,7 @@ def initialize(webpacker)
end

def inquire
fallback_env_warning unless current
fallback_env_warning if config_path.exist? && !current
current || DEFAULT.inquiry
end

Expand Down
4 changes: 3 additions & 1 deletion lib/webpacker/railtie.rb
Expand Up @@ -91,6 +91,8 @@ class Webpacker::Engine < ::Rails::Engine
end

initializer "webpacker.set_source" do |app|
app.config.javascript_path = Webpacker.config.source_path.relative_path_from(Rails.root.join("app")).to_s
if Webpacker.config.config_path.exist?
app.config.javascript_path = Webpacker.config.source_path.relative_path_from(Rails.root.join("app")).to_s
end
end
end

0 comments on commit 93152cf

Please sign in to comment.