Skip to content
This repository has been archived by the owner on Dec 29, 2019. It is now read-only.

Server side rendering with HMR enabled using Webpack + Typescript

Notifications You must be signed in to change notification settings

KubaJastrz/webpack-ssr-hmr-demo

Repository files navigation

Server side rendering with HMR enabled using Webpack + Typescript.

Usage

To run dev server:

yarn start  # runs dev server with client and server HMR enabled

Server will be live at http://localhost:3000. You can now edit src/components/App.tsx and changes should appear automatically. After page refresh, applied changes should remain visible (view the page source).

How it works

Node serves regular express instance with webpack dev and hot middlewares. That, combined with module.hot.accept in src/index.tsx, provides HMR for client side. For HMR in express server it uses webpack-hot-server-middleware.

In SSR it uses html-webpack-plugin for automatic script injection. You can see more in src/requestHandler.tsx.

About

Server side rendering with HMR enabled using Webpack + Typescript

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published