Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. Yarn acts as the package manager for the javascript libraries.
  2. Instead of using gems for the corresponding js libraries yarn can be used.
  3. The advantages are many: (Pointing a couple)
  4. - we don't have to wait for a gem to be made for a js library
  5. - we don't have to wait for the gem to be updated when a new version of the library is released.
  6.  
  7.  
  8. Yarn adds the packages to the folder `node_modules`.
  9. So the assets path will have to be updated at
  10. `config/initializers/assets.rb`.
  11. The following line will have to be uncommented.
  12. `Rails.application.config.assets.paths << Rails.root.join('node_modules')`.
  13.  
  14. Yarn creates a `yarn.lock` file to lock the versions.
  15. `yarn init` can be done to populate `package.json` ( Consider this similar to `Gemfile`, and `yarn.lock` to `Gemfile.lock`)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement