File tree Expand file tree Collapse file tree
vite_rails/lib/vite_rails Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55module ViteRails ::CLI
66end
77
8- module ViteRails ::CLI ::Build
8+ module ViteRails ::CLI ::EnsureRailsInit
99 def call ( **options )
1010 ensure_rails_init
1111 super
@@ -15,7 +15,7 @@ def call(**options)
1515 def ensure_rails_init
1616 require File . expand_path ( "config/environment" , Dir . pwd )
1717 rescue StandardError , LoadError => error
18- $stderr << "Unable to initialize Rails application before Vite build :\n \n \t #{ error . message } \n \n "
18+ $stderr << "Unable to initialize Rails application before Vite:\n \n \t #{ error . message } \n \n "
1919 end
2020end
2121
@@ -80,5 +80,6 @@ def install_sample_files
8080 end
8181end
8282
83- ViteRuby ::CLI ::Build . prepend ( ViteRails ::CLI ::Build )
83+ ViteRuby ::CLI ::Build . prepend ( ViteRails ::CLI ::EnsureRailsInit )
84+ ViteRuby ::CLI ::Dev . prepend ( ViteRails ::CLI ::EnsureRailsInit )
8485ViteRuby ::CLI ::Install . prepend ( ViteRails ::CLI ::Install )
You can’t perform that action at this time.
0 commit comments