Simple single page app pre renderer cli
Just tell rex where your app is.
rex dist
By default rex will only render the '/' route.
You can pass the routes you want prerendered using the --routes
flag.
rex dist --routes=/,/contact,/blog
You can also specify a port number. Defaults to 3000
.
rex dist --port 8080
The output should be
index.html
contact/index.html
blog/index.html
You can also add a config file named rex.config.js
,
This file merges with the cli options.
// rex.config.js
module.exports = function() {
return {
directory: 'dist' // path to to serve
routes: ['/', '/contact', '/blog'],
port: 4200
}
}