/react-static-plate

Build fast static sites with React & CSS Modules.

Primary LanguageJavaScript

React Static Plate

Build static sites with React & CSS Modules to host on Amazon S3, Github Pages, Surge etc. React | React Router | Babel 6 | CSS Modules | PostCSS | Webpack

Features

  • ES6+.
  • Hot Reloading.
  • ESLint rules based on Airbnb's Javascript Styleguide.
  • Every route is completely rendered into a .html page with renderToString.
  • Deferred script loading, so the browser can render the html without waiting for the js bundle first.
  • Hash is added to every asset's filename, so you can cache all assets forever.
  • Title, Meta and other SEO tags with react-helmet.
  • SEO friendly, no JavaScript required to view a page.
  • Generates sitemap.xml

Getting Started

Fork the repo, install the node modules and run the dev server:

$ npm install
$ npm start

Open http://localhost:3000 & have fun. 🐒

Deploy

Set your website in package.json and generate all the static files with npm run build. Then upload the contents of the build/ folder to your hosting solution of choice. Finish!

You can also check out the production build on your local machine using http-server:

$ npm install -g http-server
$ cd build
$ http-server

FAQ

My site is not working properly on Amazon S3:
Make sure you define paths with trailing slashes, like <Route path="about/">.

My site is not working properly on Github Pages:
Make sure you define paths without trailing slashes, like <Route path="about">.