提交 cfdf6e13 编写于 作者: D David Heinemeier Hansson

Add option to trigger JS framework-specific installation as part of webpack setup

上级 5d07e8a3
* Add Webpack support in new apps via the --webpack option, which will delegate to the rails/webpacker gem.
To generate a new app that has Webpack dependencies configured and binstubs for webpack and webpack-watcher:
rails new myapp --webpack
To generate a new app that has Webpack + React configured and an example intalled:
rails new myapp --webpack=react
*DHH*
* Add Yarn support in new apps with a yarn binstub and vendor/package.json. Skippable via --skip-yarn option.
*Liceth Ovalles*, *Guillermo Iguaran*, *DHH*
......
......@@ -33,7 +33,7 @@ def self.add_shared_options_for(name)
class_option :javascript, type: :string, aliases: "-j",
desc: "Preconfigure for selected JavaScript library"
class_option :webpack, type: :boolean, default: false,
class_option :webpack, type: :string, default: "base",
desc: "Preconfigure for app-like JavaScript with Webpack"
class_option :skip_yarn, type: :boolean, default: false,
......@@ -426,7 +426,10 @@ def run_bundle
end
def run_webpack
rails_command "webpacker:install" if options[:webpack]
if !(webpack = options[:webpack]).nil?
rails_command "webpacker:install"
rails_command "webpacker:install:#{webpack}" unless webpack == "base"
end
end
def generate_spring_binstubs
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册