Class: Geoblacklight::Webpacker

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

Instance Method Summary collapse

Instance Method Details

#javascript_installObject



22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/generators/geoblacklight/webpacker_generator.rb', line 22

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

#procfileObject



18
19
20
# File 'lib/generators/geoblacklight/webpacker_generator.rb', line 18

def procfile
  copy_file 'Procfile', 'Procfile'
end

#webpacker_configObject



14
15
16
# File 'lib/generators/geoblacklight/webpacker_generator.rb', line 14

def webpacker_config
  copy_file 'webpacker.yml', 'config/webpacker.yml'
end

#webpacker_installObject



10
11
12
# File 'lib/generators/geoblacklight/webpacker_generator.rb', line 10

def webpacker_install
  run 'bundle exec rails webpacker:install'
end