just-paja/improtresk-web

View on GitHub
src/server/middleware/dev.js

Summary

Maintainability
A
0 mins
Test Coverage
import express from 'express'
import webpack from 'webpack'
import webpackDev from 'webpack-dev-middleware'
import webpackHot from 'webpack-hot-middleware'

import webpackConfig from '../../../webpack/dev'

const compiler = webpack(webpackConfig)

const app = express()

app.use(webpackDev(compiler, {
  headers: {
    'Access-Control-Allow-Origin': '*'
  },
  hot: true,
  publicPath: webpackConfig.output.publicPath,
  stats: false
}))

app.use(webpackHot(compiler))

export default app