vue,angular4,react如何搭建完美的工程項目

vue,angular4,react 之webpack搭建

前端三大框架基礎項目

  • webpack3 + typescript+react

https://github.com/githbq/hbq-typescript-react-boilerplate.git
支持typescript + react16 + react-router V3css

  • webpack3 + babel(es6+) + react

https://github.com/githbq/hbq-simple-webpack2-react.githtml

  • webpack3 + typescript+vue2

https://github.com/githbq/hbq-typescript-vue-boilerplate.git前端

  • webpack3 + typescript+angular4

https://github.com/githbq/hbq-angular-boilerplate.gitvue

特色

1. 支持多入口頁面自動生成

  • src/apps/ 目錄下會建立 .ts 或者 react 下 .tsx 會自動生成 .html 文件
  • 自定義html模板: src/apps 下建立與 tsx? 同名的 [name].html , [name].pug
  • 優先使用自定義模板,不然使用dev-config/index.template.pug 做爲 htmlWebpackPlugin 模板

2. 同時支持ejspug 做爲 htmlWebpackPlugin 模板

3. 同時支持 stylusless 編寫樣式

4. 自動構建目錄在 dev-config 目錄下,配置文件徹底解耦

├── dev-config
|  ├── configs
|  |  ├── alias.js
|  |  ├── constants.js
|  |  ├── devServer.js
|  |  ├── entry.js
|  |  ├── globalConfig.js
|  |  ├── plugins.html.js
|  |  ├── plugins.js
|  |  ├── proxy.js
|  |  ├── rules.css.js
|  |  ├── rules.js
|  |  └── utils.js
|  ├── index.template.html
|  ├── index.template.pug
|  ├── lite-server-config.js
|  ├── readme.md
|  ├── templateCompilers
|  |  └── pug.js
|  └── webpack.config.js

5. hmr(hot module replace) 代碼修改熱更新支持

安裝

1. 直接 git clone 對應的git倉庫地址

2. 採用 iclone-cli 腳手架

npm i -g iclone-cli 
// then 
iclone init -t  [模板名稱] -n [工程名稱]

環境要求

nodejs v8.4

win nodejs v8.4 百度雲盤下載連接 http://pan.baidu.com/s/1bpD78YF
mac 系統直接使用 n latest獲取最新版本便可node

開發工具安利

VSCODE : 這真的很快很好用

win vscode 最新版 x64-1.16.0 百度雲盤下載連接 http://pan.baidu.com/s/1bpB5FEfreact

本人其它模板項目

  • koa2 + typescript + mongodb

https://github.com/githbq/hbq-koa2-base.gitwebpack

  • nodejs command line

https://github.com/githbq/hbq-module-cli-boilerplate.gitgit

  • gulp (css js less ts gzip)

https://github.com/githbq/hbq-gulp.gites6

TODO

  • README.md 文檔尚未寫好,挨個寫清楚
  • 前端單元測試待加入
  • 編寫typescript 開發相關文檔

歡迎你們提意見!

相關文章
相關標籤/搜索