Server side rendering for react.js applications.
npm install @borderless/site --save-dev
- Server-side rendering with
getServerSideProps
- Client-side hydration for interactivity
- Custom
<Head />
rendering with@borderless/site/head
- Hot reloading and react refresh during development
- Super fast server with Vite
- ES Modules supported
Options:
--root
Project root directory (default:process.cwd()
)--src
Directory to read source files (default:src
)--public-dir
Directory to serve as plain static assets (default:public
)
Commands:
dev
Run a local development server with HMRbuild
Generate client and server-side compatible bundleslist
List the pages in your SSR app
Run a local development server with hot reload support
Options:
--host
Specify the host to run on (default:127.0.0.1
)--port
Specify the port to run on (default:8000
)
Build client and server-side bundles for deploying to a production environment.
Options:
--base
Base public path when built in production (default:/
)--client-outdir
Output directory for client files relative to root (default:dist/client
)--server-outdir
Output directory for server files relative to root (default:dist/server
)--source-map
Generate production source maps (default:false
)
Lists the files used to build the project. The pages are all in root and follow the patterns of _app
, _404
, _document
, or pages/**/index
. Acceptable extensions are .ts
, .tsx
, .js
, and .jsx
.
Useful scripts are in package.json
under scripts. You can build, test, and format the project. Additionally you can run examples locally using ts-node
:
npm run build
npm run example:test -- build
npm run example:test -- dev
Test pages:
This project is written using TypeScript and publishes the definitions directly to NPM.
MIT