Skip to content

Commit

Permalink
feat: Detect installations of the latest version of Webpacker (app/pa…
Browse files Browse the repository at this point in the history
…cks)
  • Loading branch information
ElMassimo committed Mar 9, 2021
1 parent 12eed58 commit e9a3bc0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vite_rails/lib/vite_rails/installation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ module ViteRails::Installation
# Override: Setup a typical apps/web Hanami app to use Vite.
def setup_app_files
cp RAILS_TEMPLATES.join('config/rails-vite.json'), config.config_path
if root.join('app/javascript').exist?
Dry::CLI::Utils::Files.replace_first_line config.config_path, 'app/frontend', %( "sourceCodeDir": "app/javascript",)
if dir = %w[app/javascript app/packs].find { |path| root.join(path).exist? }
Dry::CLI::Utils::Files.replace_first_line config.config_path, 'app/frontend', %( "sourceCodeDir": "#{ dir }",)
end
setup_content_security_policy root.join('config/initializers/content_security_policy.rb')
end
Expand Down

0 comments on commit e9a3bc0

Please sign in to comment.