Closed mattgibson closed 8 years ago
This is a very simple app. Similar to redux real world example everything's on one express server. You probably want to create another development express server like the one erikras/react-redux-universal-hot-example
uses, or maybe require webpack.dev
conditionally? (please, let me know of the result)
if (process.env.NODE_ENV !== 'production') {
require('./webpack.dev')(app);
}
app.use(express.static(path.join(__dirname, 'dist')));
Tried it myself and it worked but I had to move babel
to the production section (because of this line in index.js
: require('babel/register')({});
).
But to run npm run build
you have to install the dev dependencies anyway.
p.s. I'll send a fix today-tomorrow
Hopefully #30 resolves this issue.
Fixed it using require('./webpack.dev');
as above. You do need to have all the deps for build, but they don't need to be sent to the browser, so I think the fix helps. Thanks for investigating so fast :)
Wipe out the node_modules folder with
rm -rf node_modules
, reinstall withnpm install --production
and then trynpm start
.Errors appear about missing babel and other dev modules because of this line in
server.jsx
:The conditional below is used to actuall run the imported function, but the files are all included anyway, leading to a very heavy slug on Heroku.