sveltejs / template-webpack

Template for building basic Svelte applications with webpack
300 stars 118 forks source link

Fix HMR breaking components styles #3

Closed kaisermann closed 6 years ago

kaisermann commented 6 years ago

Related to https://github.com/sveltejs/svelte-loader/issues/61

Rich-Harris commented 6 years ago

Excellent, thank you for tracking this down!

Does the contentBase thing mean that static assets in public can't be used in dev? I assume this was about not making sure stale built assets didn't take precedence over files emitted by webpack (another webpack eyeroll moment 🙄) but what if we did want to load assets from there, e.g. fonts?

kaisermann commented 6 years ago

We can still use static assets in dev because of that --content public on the dev npm command (global.css is still working). Hooowever, while on dev, the index.html is trying to load the, now inexistent, bundle.css. I'm not sure what's the best solution to this other than using something like mini-html-webpack-plugin 🤔