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

Check for webpacker.yml before setting source #2366

Merged
merged 2 commits into from Nov 12, 2019
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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