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



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

#procfileObject



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

def procfile
  copy_file 'Procfile', 'Procfile'
end

#webpacker_configObject



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

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

#webpacker_installObject



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

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