1

My app loads a few different files at runtime that are NOT compiled/known by webpack. Language files (.json), some external css styles (.css).

When my app runs on webpack-dev-server, i'd like it to receive updates for these files when they change - i'd write a small chunk of code to pass the new external language files to language manager (for example).

Is it possible to use Webpack HMR for this? If not, I guess I need to run two servers (webpack dev server, plus my custom HMR server?).

I've tried using import.meta.webpackHot to try to accept the change - webpack does notice the file has changed but HMR says "Nothing Changed" - presumably because Webpack doesn't think its relevant?

Any steer would be useful.

Thanks

mct2386
  • 51
  • 3
  • It seems that Webpack wants to control everything by default. It wants to know about every single file, every format, at compile time. This is not ideal for larger apps, notably white label applications. Or if you want to separate skinning from app/component development. So in short, to use Webpack i'd have to write plugins, use dynamic imports and let webpack compile the whole thing everytime eek. I'm going to walk away from Webpack, architecturally I don't like putting all my eggs in one basket. I want some level of control that I can't wrestle off Webpack. – mct2386 Sep 28 '22 at 05:15

0 Answers0