iansinnott / react-static-boilerplate

A boilerplate for building static sites with Webpack 2, React and React Router
107 stars 16 forks source link

Does this address the same concerns as Mark Dalgleish's plugin? #13

Closed f0rr0 closed 8 years ago

f0rr0 commented 8 years ago

https://github.com/markdalgleish/static-site-generator-webpack-plugin

iansinnott commented 8 years ago

I definitely had a look at that plugin before creating this. The main reason I decided to write my own library was that it seems redundant to have to specify your routes manually. When you write a routes configuration for React Router it describes all possible paths in your application. I figured there must be a way to use that to generate paths instead of manually creating an array of all possible paths.

Reading paths directly from your routes is part of the larger goal of this project to nearly eliminate the need for further configuration in order to generate a static site. Meaning I wanted to be able to drop the webpack plugin into any existing webpack/react/react-router app and have it just work.

But the two projects are very similar in the end result, if I understand how that project works correctly. I would recommend just using whichever one better suits the needs of your project.

f0rr0 commented 8 years ago

@iansinnott I think one can avoid hardcoding the routes altogether by using something like https://www.npmjs.com/package/react-router-to-array

iansinnott commented 8 years ago

oooh nice! I had no idea someone had already written this. Thanks for the heads up.