Closed non25 closed 3 years ago
Did some testing on sapper-template-webpack
, everything seems working with svelte-loader
3.0.0, but enabling HMR results in the following error:
Module parse failed: 'import' and 'export' may only appear at the top level
It doesn't work because Webpack 4 uses acorn
v6, which can't eat it up for some reason. I remember using resolutions in yarn to override acorn
to be v7+.
Maybe it is worth it to explore Webpack 5 instead, because maintaining npm/yarn compatible resolutions/overrides for transitive deps is kinda fragile.
I wouldn't spend a lot of time on anything Sapper related. I'd be just as happy to turn off HMR and call it a day
I've added comment on how to make it work. Better than nothing I guess. :roll_eyes:
I'm not sure about HMR working out of the box, because it may need Webpack HMR plugin or dev server, which I'm not sure sapper provides. :thinking: Will add some commits later.
Fixes #307