I want to subscribe or somehow detect the imported file change in React application. This feature is required for development mode only.
For example, this code that imports SVG (I imagined how it could be, but actually any other way is accepted)
import myIcon from './myicon.svg';
function IconSet()
{
webpack.hot.reload.detector(myIcon).on('change', function(oldMyIcon, newMyIcon)
{
// Here I can get new myIcon object and process this by myself
// ...
});
}
Is there any way to make this?
Thanks!