一個新的Webpack樣板文件:React Transform Boilerplate

ygp8 9年前發布 | 37K 次閱讀 前端技術 React Transform Boilerplate

一個新Webpack樣板文件包括:

  • 熱加載React 組件;
  • 錯誤處理在componentrender()function內部;
  • error handling for syntax errors (thanks, @glenjamin!)

Built with babel-plugin-react-transform and a few custom transforms.
Does not use React Hot Loader.

Demo

git clone https://github.com/gaearon/react-transform-boilerplate.git
cd react-transform-boilerplate
npm install
npm start
open http://localhost:3000

Then go ahead and edit files insidesrc(any file exceptindex.js).

What’s Inside

The component instrumentation is implemented on top of babel-plugin-react-transform:

The syntax errors are displayed in an overlay by @glenjamin’s webpack-hot-middleware which replaces Webpack Dev Server.

項目主頁:http://www.baiduhome.net/lib/view/home/1441425990643

 本文由用戶 ygp8 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!