Today I Learned

TIL, 2017-12-23, NPM, Yarn, Babel, Webpack

  • webpack --h | more: Pipe to more to see command outputs in pages.

What are NPM, Yarn, Babel, and Webpack; and how to properly use them?


  • NPM: Package manager for Node based environments. The external dependencies get stored in a file called package.json.
    • npm init to create that initial file.
  • Yarn: A package managed that uses the NPM registry as its backend, but it creates a yarn.lock file to store the exact versions of dependencies to the last digit. Yarn creates and updates this lock file when things get installed, NPM needs to do shrinkwrap function. Also, Yarn is faster.
  • Babel: ES6 makes JS great again. Babel is a JS transpiler that converts new JS code into old ones.
  • Webpack: To use SASS for styles, PostCSS for auto-prefixing, minification of code, we can use Webpack.
    • Loaders: transform the source code of a module.
    • Plugins: Does the things taht loaders can’t.
  • So you add using yarn.
  • You differentiate between not having the loader and not finding the file in webpacker.
  • The Vue thing is bad when you use the generator from webpacker.
  • form_with exists?

This project is maintained by daryllxd