In StackBlitz it's possible to add another JS file(s) (besides index.js) but it seems that only index.js is actually being loaded. All the functions defined in other JS files created in the same (root) folder are just undefined when I try to call them within the index.js. I tried to 'activate' other files via HTML (<script src='./filename.js'> tag) but it didn't help. What am I doing wrong?
Add a comment
|
2 Answers
in index.js:
import {func} from './myscript.js';
In myscript.js:
exports.func = function(){...}
4 Comments
CodyBugstein
But then how do you use a function described in
myscript.js inside index.js ?P.S.
@CodyBugstein, like this: stackblitz.com/edit/svelte-imozn2?file=index.js
CodyBugstein
Can you also take a look at this question? stackoverflow.com/questions/52898665/…
CodyBugstein
(btw I cannot award bounty for another 21 hours, but I will asap)