oTree Forum >

Installing js dependencies

#1 by ydydxhg

HI There,

I am new to oTree, so not sure if I missed anything here.

I am wondering what is the best way to install js packages to the frontend? does it support npm install? Couldnt seem to be able to find any result in the document search

Thanks so much
Paul

#2 by coralio (edited )

If they are traditional JS libraries, you can add <script src="YOUR LIBRARY URL/PATH"></script> in the head or body of your html file. Otherwise, with npm packages it is more difficult, because npm packages have to be converted to a more "traditional" Javascript that a web app can understand. This involves using, for instance, Webpack and Babel. But I don't know...
JUST GOOGLE: django npm package in frontend
AND FIND OUT.

Write a reply

Set forum username