jepa v0.0.22
jepa · 
A
highlycustomizable React framework for painless SPAs.
Getting Started
yarn add jepa react react-dom
# or
npm install --save jepa react react-domTable of Contents
Customization
Files
You can optionally replace the following files:
src/server/index.js: The server entrypoint.src/server/renderServerWrapper.js: A function that takes aReact.Componentand return an object of shape:{ renderedRoot: React.Component, // HTML string that will be placed after other styles in the head. style: String, // HTML string that will be placed before other scripts in the end // of the body, useful for providing SSRed stores, for example // Redux or Apollo stores. script: String }src/client/renderClientWrapper.js: A function that takes aReact.Componentand returns a React component.src/universal/Root.js: The root of the universal app.
jepa.options.js
name(String): The name of the project.host(String): Defaults to0.0.0.0.port(Number): Defaults to3000.clientDevServerPort(Number): Defaults to3001.basePath(String): The base URL the app will be mounted at. Useful when your app is served behind a proxy. Defaults to/.getRouter(AsyncFunction): An async function that returns anexpressrouter.compress(Boolean|Object): Set this totrueor object withcompressionoptions to enable HTTP compression. Defaults to!__DEV__.faviconrobotsTxt(String)manifestJson(Object)
TODO:
staticDir(String)bodyParser(Boolean|Object)loggerforceSslsslPortsecurityTxt(String): (https://securitytxt.org/)
Environment Variables
Environmental variables can be used to override options that were set in
jepa.options.js during startup time. You can place a .env file in
src/ folder.
The following variables are currently supported:
process.env.HOSTprocess.env.PORT
jepa.config.js
webpackModify(AsyncFunction): A function that takes an object argument of shape{webpackConfig, target: 'web' || 'node', env: 'dev' || 'prod'}, and should return a webpack config object.postcss(Object):postcss-loaderoptions.
Runtime Dependencies
By default both client and server are bundled with Webpack, which means
there is no use of node_modules during runtime. Most of the time this
works perfectly fine however there are cases when certain dependencies
can't be bundled (usually these are native dependencies).
You can create a package.json file and optionally package-lock.json
or yarn.lock files and specify dependencies there that shouldn't be
bundled with Webpack and installed to node_modules.
7 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago