我的半桶水前端栈
这篇博客是前面几篇有关前端博客的总结。
包管理器
大约一年前,我写前端还用 Bower 来作为前端的包管理器。
$ bower install what-you-need 将依赖安装到 bower_components 中,(或者通过 .bowerrc 配置安装的路径)。
配合 wiredep ,在 index.html 中 <!-- bower:css --><!-- endbower --> 和 <!-- bower:js --><!-- endbower --> 即可导入所有依赖。
而最近了解了 WebPack 之后,更喜欢 npm + webpack 来作依赖管理。
$ npm install what-you-need
$ npm init # Create package.json
index.js:
import DepOne from 'scripts ...