Open michaek opened 8 years ago
I am copying over some LESS files to my dist folder. Would be great if I can change my LESS and have HMR. Has anyone go that working??
@jrmcdona It's probably preferable to use the less loader and include your output CSS in the Webpack bundle. The approach described here would be best for files that can't be addressed as modules by loaders (and thus make use of hot module reloading).
This is supporting the case of files modified by plugins (CopyWebpackPlugin, HtmlWebpackPlugin) that can't be sent via HMR because they're not required in a bundle. A simple case is documented here.
The config might look something like
and it's assumed that sending the object key and changed file path to the client is sufficient to respond with something like
The approach is currently naive (I've even left out the chokidar dependency!) I'm just hoping to start a discussion about solving a case that doesn't fit within HMR but nonetheless seems to cause a certain amount of headache.