diff options
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/generators/app_base.rb | 6 | ||||
-rw-r--r-- | railties/lib/rails/generators/rails/app/app_generator.rb | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb index 410e53b4c0..2e4797e5bb 100644 --- a/railties/lib/rails/generators/app_base.rb +++ b/railties/lib/rails/generators/app_base.rb @@ -399,6 +399,10 @@ module Rails !options[:skip_spring] && !options.dev? && Process.respond_to?(:fork) && !RUBY_PLATFORM.include?("cygwin") end + def webpack_install? + !(options[:skip_javascript] || options[:skip_webpack_install]) + end + def depends_on_system_test? !(options[:skip_system_test] || options[:skip_test] || options[:api]) end @@ -420,7 +424,7 @@ module Rails end def run_webpack - unless options[:skip_javascript] + if webpack_install? rails_command "webpacker:install" rails_command "webpacker:install:#{options[:webpack]}" if options[:webpack] && options[:webpack] != "webpack" end diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb index cefaffcb20..b118ea989b 100644 --- a/railties/lib/rails/generators/rails/app/app_generator.rb +++ b/railties/lib/rails/generators/rails/app/app_generator.rb @@ -261,6 +261,9 @@ module Rails class_option :webpack, type: :string, default: nil, desc: "Preconfigure Webpack with a particular framework (options: #{WEBPACKS.join('/')})" + class_option :skip_webpack_install, type: :boolean, default: false, + desc: "Don't run Webpack install" + def initialize(*args) super |