Class: HotwireDebug::WebpackerGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/hotwire_debug/webpacker/webpacker_generator.rb

Instance Method Summary collapse

Instance Method Details

#append_importsObject



8
9
10
11
# File 'lib/generators/hotwire_debug/webpacker/webpacker_generator.rb', line 8

def append_imports
  inject_into_file 'app/javascript/packs/application.js', "\nimport '../vendor/hotwire-debug';\n"
  inject_into_file 'app/javascript/stylesheets/application.scss', "\n@import '../vendor/hotwire-debug';\n"
end

#copy_assetsObject



4
5
6
7
# File 'lib/generators/hotwire_debug/webpacker/webpacker_generator.rb', line 4

def copy_assets
  template "hotwire-debug.js", "app/javascript/vendor/hotwire-debug.js"
  template "hotwire-debug.scss", "app/javascript/vendor/hotwire-debug.scss"
end