Using several JS files in StackBlitz with a simple JS-project
I have tried this and worked for me.
In index.js add below statement
import "./myscript.js";
in index.js:
import {func} from './myscript.js';
In myscript.js:
exports.func = function(){...}