React Static Site Webpack plugin
Inspired by static site generator webpack plugin, but instead of hand-coding a path array, I chose to parse React Router's Route
tree to generate a path array. Even then, I can only make sure it will work only with simple usage of React Router.
Pre-requisites
- Node JS (6 is preferrable)
- yarn (some scripts will not work with npm)
Usage
- Build
yarn build
or
npm build
- Examples: refer to example, or:
const App = <div> children != null ? ReactChildren: '' </div> const Home = <div> <h1>Hello World!</h1> <i className='fa fa-copyright'></i> 2016 All Rights Reserved <br /> Designed and coded by <br /> <a href='mailto:keisau.ching@pierresaux.me'> `Keisau 'PierreSaux' CHING` </a> </div> const Index = <div> <h1>Index Page</h1> <i className='fa fa-copyright'></i> 2016 All Rights Reserved <br /> Designed and coded by <br /> <a href='mailto:keisau.ching@pierresaux.me'> `Keisau 'PierreSaux' CHING` </a> </div> const routes = <Route path='/' component=App > <IndexRoute title='Index' component=Index /> <Route path='home' title='Home' component=Home/> </Route> routes { const history = const location = historylocation /* access route's props */ const title = routeprops const template = return { } }
Contribute
I am looking forward to feedbacks. Make sure your issues or emails state the main point and cover:
- Facts,
- Constructive opinions, or
- Working codes that improve/fix