Wow! That works! I thought about it before, but Linter always gets an error "Unexpected use of file extension “js” for “./modules/UI.js” ". For that reason, I was sure that the path doesn’t require an extension…
These errors come from Linter. Objects like alert or document are not defined for it.
The linter is designed for webpack and similar. Unless you can configure your webserver backend to serve up JS files without a suffix (it’s a trivial rewrite rule), you’ll need to use the suffix in your import statements.
ES6 modules in the browser are a neat idea, but there’s way too many deployment problems right now for them to be practical. Most people don’t want to wait for their web browser to do the equivalent of npm install when they visit a new site, so until they get the dependency management nailed (even caching isn’t enough for this), webpack and company will continue to dominate.