Proper way to import a whole .js file

I need to use a .js script inside of one of my components. What is the proper way to use a whole .js file in StencilJS?

I tried using the Require() funtion but I get this error.


Then I tried to import is with import * as Foo from './foo.js but it didn’t work, the file was considered undefined.

I’m converting my app from Angular to Ionic, if that can help.