How to lazy load my js component?

I configured my framework7 project using webpack. I’m looking to load only those components which are needed on current page.My code is:-

    import HomeScreenUtilities from './HomeScreen.js';

But import statements are only allowed at the top of the file. How can i achieve this?

Check how imports work