Update page.js files to v6 webpack

I’m trying to update my app from v5 to v6 webpack. I have more or less understood how to include the single page.html and get them correctly compiled with webpack. However I do not understand how to handle the page.js files with the event functions.
As exercise I modified the template Split View including in src/js/ a new file “myfile.js” with a simple page event and command

But I get the following error :


Can anyone help me?

You need to understand how JS modules work https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules

Your error message is pretty self explaining. You need to import $ from 'dom7' in files where you use it

geat, understood what is needed
Many thanks.