Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jspsych-psychophysics plugin in the builder #40

Open
franfrutos opened this issue Sep 26, 2022 · 1 comment
Open

jspsych-psychophysics plugin in the builder #40

franfrutos opened this issue Sep 26, 2022 · 1 comment

Comments

@franfrutos
Copy link

I would be interested in using the jspsych-psychophysics plugin. Unfortunately it doesn't seem to be available for use via npm. Is there any way I can use the plugin code to make it accessible for use with jspsych builder?

Thanks in advance, and sorry if this is a trivial question.

@bjoluc
Copy link
Owner

bjoluc commented Sep 30, 2022

Hi @franfrutos, this is everything but trivial 😄 The root problem is that jspsych-psychophysics is not available as an ES module. This is the same problem as jspsych/jspsych-contrib#26 (comment). The reason jspsych-builder doesn't support jspsych-psychophysics out of the box is that jspsych-builder's builtin compatibility hack only applies to @jspsych-contrib-scoped packages that don't export modules. You can manually work around it via

import jsPsychPsychophysics from "imports-loader?type=commonjs&imports=single|jspsych|jsPsychModule!exports-loader?type=commonjs&exports=single|jsPsychPsychophysics!./jspsych-psychophysics.js";

@tpronk @kurokida so you get a notification too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants