I've looked into ES6 modules and require.js but both need a "script" tag on the executing page to be able to use them.
In content scripts we just specify the list of js files to be injected on the webpage and no script tag is used. Is there a module loader i am not aware of that doesn't have dependency on the script tag? Currently i am just using IIFE and global scope to access the required objects but it would be really convenient if i could use a module loader since the size of my extension code is growing day by day.
Note - I am aware of this answer here How to import ES6 modules in content script for Chrome Extension but it suggests to do it via web_accessible_resources but that's not an ideal option cause all scripts injected to page this way have to use message passing to access anything from extension or content script (kind of a workaround).