This is to be a quick development/production server that will take react components make pages for them and bundles that with auto reload.
This is to be based of a few directories inside the project.
app
├── components
├── package.json
└── templates
Components is where all you components will live this can be top level, or sub components.
- "/" => "components/index.js"
- "/foo" => "components/foo.js"
unless another mapping is set in the package.json
Templates is where the the outer templates for the components will live these are exported functions that return a react html document. By default templates/index.js
is used.
The idea behind this is to reduce the amount of configuration to get an isomophic react app up and working, but of course a config is needed. Rather then adding another file to the root of your app you can use the package.json
{
"rcs": {
"defaults": {},
"componentsDir": "components",
"templatesDir": "templates",
"routes": {
"/foo": "bar.js",
"/bar": {
"component": "bar.js",
"template": "_layout.js"
}
}
}
}