ericclemmons/webpack-hot-server-example

Adding babel env preset breaks example

Opened this issue · 2 comments

I've been diving into webpack a little deeper than usual lately trying to get a nicer dev setup for a project of mine. It's a bit of a bigger project and in trying to get HMR working on the server and client, I was trying to figure out why the server portion wasn't working like this example. I figured out adding babel-preset-env breaks the example entirely. I'm not quite sure why since there are a lot of moving parts but I thought I'd at least start the conversation here.

I also made a diff of the changes the preset makes in the built server file here.

The fix for me in the meantime was to just move this preset to the production section of my .babelrc file. Maybe there is no way around this?

@okcoker did you ever figure this out? I'm passing --env.dev and server-side HMR is working, but only when I use a single webpack config as opposed to multiple webpack configs for client and server respectively. I'm not sure if this is a webpack, webpack.HotModuleReplacementPlugin, or wds issue.

I don't think so but I've since moved on to babel7, with react-universal-component, hot-server-middleware and hot/dev-middleware