Skip to content

Commit

Permalink
added react overlay on cli template by default. dev only. see issue s…
Browse files Browse the repository at this point in the history
  • Loading branch information
tsiq-swyx committed Feb 1, 2018
1 parent 2bc36a8 commit 2fb8175
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/react/src/server/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Router } from 'express';
import webpack from 'webpack';
import webpackDevMiddleware from 'webpack-dev-middleware';
import webpackHotMiddleware from 'webpack-hot-middleware';
import errorOverlayMiddleware from 'react-dev-utils/errorOverlayMiddleware';
import getBaseConfig from './config/webpack.config';
import loadConfig from './config';
import { getMiddleware } from './utils';
Expand Down Expand Up @@ -38,6 +39,7 @@ export default function(configDir) {
const webpackDevMiddlewareInstance = webpackDevMiddleware(compiler, devMiddlewareOptions);
router.use(webpackDevMiddlewareInstance);
router.use(webpackHotMiddleware(compiler));
router.use(errorOverlayMiddleware());

// custom middleware
middlewareFn(router);
Expand Down
5 changes: 5 additions & 0 deletions lib/cli/generators/REACT/template/.storybook/config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { configure } from '@storybook/react';

if (process.env.NODE_ENV !== 'production') {
require('react-error-overlay');
require('react-dev-utils/webpackHotDevClient')
}

// automatically import all files ending in *.stories.js
const req = require.context('../stories', true, /.stories.js$/);
function loadStories() {
Expand Down

0 comments on commit 2fb8175

Please sign in to comment.