Feat: Add react-hot-loader

Combine webpack and browser-sync on one port
This commit is contained in:
Berkeley Martinez
2016-09-27 10:57:56 -07:00
parent d3f8757e92
commit a6f9e95ed8
7 changed files with 58 additions and 83 deletions

View File

@@ -1,7 +1,4 @@
import manifest from '../rev-manifest';
/* eslint-disable import/default */
import config from '../../webpack.config';
/* eslint-enable import/default */
let chunkManifest;
try {
@@ -30,16 +27,9 @@ function removeOldTerms(str = '') {
return str.replace(challengesRegex, '');
}
function getBundleLocation() {
return __DEV__ ?
config.output.publicPath + '/bundle.js' :
rev('/js', 'bundle.js');
}
export default function jadeHelpers() {
return function jadeHelpersMiddleware(req, res, next) {
res.locals.removeOldTerms = removeOldTerms;
res.locals.getBundleLocation = getBundleLocation;
res.locals.rev = rev;
// static data
res.locals.user = req.user;