Noob question: How can I make my extension a module? #3101
Unanswered
AdamVasarhelyi2
asked this question in
Q&A
Replies: 1 comment
-
Here is an update for anyone willing to help: I think what I need to do is use the typescript template rather than js. In the typescript file, I would like to import tensorflow The only way I could make this work was by adding tensorflow to the package.json as a dependency, which JsPsych then loads into the root node_modules. Is this the proper way to import files over URL when making a plugin for JsPsych? I've spent ages trying to find an alternative and this is the only thing that works. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm quite new to modules.
My program works when I add the following to index.html
<script type="text/javascript" src="js/jspsych-meye-extension.js"></script>
But when I change script type to module, the file that initializes my experiment (source.js) says that the extension name isn't defined. I'm trying to make the extension a module so I can import other files into it, but JsPsych doesn't seem to like modules added to index.html.
Anyone know what I can do about this? Thanks :)
Beta Was this translation helpful? Give feedback.
All reactions