- Update sitemap to add pages with unique ID
- Css modules - variable and global stuffs
- Create sitemap.xml and register that with google https://www.youtube.com/watch?v=xtoAfUB6Ubw
- Read up on critical rendering path on udacity
- keep alive
- Rendering performance reflow
- deploy to netlify
- css modules using
react-css-modules
. By using css module we can also hash the css names - Meta for discovery using Open Graph protocol (meta tag with og scheme)
- Code and CSS splitting
- Getting react library via CDN helps in minimising bundle size. Set
react
andreact-dom
asexternals
in webpack config - Webpack path alias and additional configuration for Typescript
- Pre-rendering using puppeteer
- There are additional steps that have to be wired together:
- Start application after bundling
- pre-render pages
- Add them to
build
folder
- There are additional steps that have to be wired together:
- Isomorphic rendering is achieved for production
- When building for production,
prerender-xs
is used to generateindex.html
for all routes - Pre-rendered contents of
build
folder will be served byexpress
located intest-server
folder or simply by runningnpm run deploy:express
- Note that this is isomorphic rendering which means that after an
index.html
is served for a particular route any otherreact-router
navigation using<Link>
component remains asclient-side-routing
- When building for production,
- Mock api is configured in webpack.dev.ts using
connect-api-mocker
package- Configure
webpack-dev-server
inwebpack.dev.ts
to serve mock API - Make sure mocks are available. Look at
JsonPlaceholderApi.ts
to see how is it set up. - Switch between mock and non-mock mode in
configs.ts
- Configure
- Deployment to netlify is possible by running
npm run deploy:netlify
after installingnetlify-cli
npm package - Sitemap will be automatically generated based on routes defined for react-router in
routes.ts
- Sitemap.xml can be added to robot.txt
- How to SEO
- When trying to code-split Typescript there it's necessary to set
module
toesnext
intsconfig.json
. If you're using typescript webpack configuration there will be extra steps that needs to be taken. That's to:- install
cross-env
- add
tsconfig.webpack.json
so that webpack configuration doesn't get read as esnext modules - add
TS_NODE_PROJECT=tsconfig.webpack.json
to npm run scripts
- install