solid-refresh icon indicating copy to clipboard operation
solid-refresh copied to clipboard

Troubleshooting steps to make HMR work in complex webpack configs

Open non25 opened this issue 1 year ago • 0 comments

Hello!

I've spent some time figuring out why it didn't work for me in webpack 5.

And it appears that you need to force webpack to use development export condition.

The simpler way to do this is to use resolve.conditionNames.

The complicated way to do this, which I used initially is to force paths with aliases:

alias: {
  'solid-js$': require.resolve(`solid-js/dist/${prod ? 'solid' : 'dev'}.js`),
  'solid-js/web$': require.resolve(`solid-js/web/dist/${prod ? 'solid' : 'dev'}.js`),
  'solid-js/store$': require.resolve(`solid-js/store/dist/${prod ? 'solid' : 'dev'}.js`),
}

So here's slight readme adjustment to hint that to avoid some confused head-scatching for someone else. :sweat_smile:

Thanks for the plugin! Works real good. :grin: Even render-props work, wow. :tada:

non25 avatar May 29 '24 03:05 non25