1.1.0-alpha.19 • Published 4 years ago

ssr-fatigue-hmr v1.1.0-alpha.19

Weekly downloads
2
License
ISC
Repository
github
Last release
4 years ago

ssr-fatigue-hmr

An Express middleware for setting up webpack dev/hot middlewares.

Installation

$ npm i -D ssr-fatigue-hmr

Usage

const express = require('express')
const webpackHMR = require('ssr-fatigue-hmr')

const webpackConfig = require.resolve('../webpack.config.js')

if (process.env.NODE_ENV === 'development') {
  app.use(
    webpackHMR({
      webpackConfig,
      publicPath: '/inc/', // mount point of build assets
    })
  )
}
app.use('/inc', express.static(path.resolve(__dirname, '..', 'build')))