Class: Geoblacklight::Webpacker
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Geoblacklight::Webpacker
- Defined in:
- lib/generators/geoblacklight/webpacker_generator.rb
Instance Method Summary collapse
- #javascript_install ⇒ Object
- #procfile ⇒ Object
- #webpacker_config ⇒ Object
- #webpacker_install ⇒ Object
Instance Method Details
#javascript_install ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/generators/geoblacklight/webpacker_generator.rb', line 21 def javascript_install # This overrides the default dependencies specified using # webpacker:install copy_file 'package.json', 'package.json' yarn_available = system('yarn --version') if yarn_available run 'yarn install' run 'yarn upgrade' else run 'npm install' run 'npm update' end end |
#procfile ⇒ Object
17 18 19 |
# File 'lib/generators/geoblacklight/webpacker_generator.rb', line 17 def procfile copy_file 'Procfile', 'Procfile' end |
#webpacker_config ⇒ Object
13 14 15 |
# File 'lib/generators/geoblacklight/webpacker_generator.rb', line 13 def webpacker_config copy_file 'webpacker.yml', 'config/webpacker.yml' end |
#webpacker_install ⇒ Object
9 10 11 |
# File 'lib/generators/geoblacklight/webpacker_generator.rb', line 9 def webpacker_install run 'bundle exec rails webpacker:install --force' end |