how to preload images with webpack

For example I have module “menu”. This module depends on menu.js, menu.css modules. In menu.css there are some styles with image url. For example there is menu.sprite.png And I have module “”. When you click “load menu” button on home page, I want for menu.css and menu.sprite.png to be loaded before showing module “menu”. How can I do loading images with webpack? Is there any loader which adds img tag on page and then uses onload event for this image?

Author: Fantashit

1 thought on “how to preload images with webpack

Comments are closed.