text: import webpack from 'webpack';
  import webpackDevMiddleware from 'webpack-dev-middleware';
  import webpackHotMiddleware from 'webpack-hot-middleware';
  import config from '../webpack.dev.config';
  
  const compiler = webpack(config);
  
  const useDevServer = app => {
    app.use(
      webpackDevMiddleware(compiler, {
        publicPath: config.output.publicPath,
      })
    );
  
    app.use(webpackHotMiddleware(compiler));
  };
  export default useDevServer;
  