http://nithinbekal.com/posts/rails-5.1-features/
我在想,我们这次是不是跑在了Rails的前面?要不要等等它?
Yarn is part of the default stack
In my previous post, I wrote about using yarn with Rails. With Rails 5.1, you no longer have to do anything - it will be supported out of the box. Yarn is the equivalent of Bundler for JS libraries, and this will make it a lot easier to manage those dependencies.
Webpack option
Rails’ official webpacker gem now makes it easy to integrate webpack with Rails apps. Rails has a --webpack
option to add this gem to Gemfile, and set up the project to work with Webpack.
Easily add React, Angular or Vue.js
With the introduction of webpacker, you also have to option of easily setting up React, Angular or Vue.js as part of our Rails project. Webpacker takes care installing the dependencies, and creating the configuration files.
# For new projects
rails new foobar --webpack=react
# in existing projects
rails webpacker:install:react