Class: RocketCms::WebpackGenerator

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

Instance Method Summary collapse

Instance Method Details

#app_nameObject



6
7
8
# File 'lib/generators/rocket_cms/webpack_generator.rb', line 6

def app_name
  Rails.application.class.name.split("::")[0]
end

#installObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/generators/rocket_cms/webpack_generator.rb', line 11

def install
  copy_file ".babelrc", ".babelrc"
  copy_file "webpack.config.js", "config/webpack.config.js"

  copy_file "webpack/application.es6", "webpack/application.es6"
  copy_file "webpack/application.sass", "webpack/application.sass"

  copy_file "webpack/errors/index.es6", "webpack/errors/index.es6"
  copy_file "webpack/errors/index.sass", "webpack/errors/index.sass"
  copy_file "webpack/errors/errors.handlebars", "webpack/errors/errors.handlebars"

  copy_file "webpack/flash/index.es6", "webpack/flash/index.es6"
  copy_file "webpack/flash/index.sass", "webpack/flash/index.sass"

  remove_file "package.json"
  template "package.json", "package.json"
end