Importing modules with sync and typescript into the editor

hey guys, i’m currently trying to make a local repository for playcanvas using ts and playcanvas-sync. I manage to make it all work, but when i try to use external modules, the modules in node_modules are not being synchronized into playcanvas. I think this is a problem with my tsconfig or something like that, but i can’t figure out.
for example, i’m trying to use zappar universalAr GitHub - zappar-xr/zappar-playcanvas: Universal AR for PlayCanvas.
the codes are built fine, but when I try to run the project it tells me that zappar is not defined. the way I manage to solve this is to either copy the zappar files directly into the editor, or to link it on the settings/external scripts
is there a way of playcanvas to sync external libs from node_modules automatically or i have to always link the external codes into the settings?

Hi @zanatta and welcome,

Normally there isn’t any reason to sync the node_modules folder with the PlayCanvas editor.

Your local bundler (e.g. rollup, webpack, typescript) is responsible for including the required libraries with your own code. That single bundle can then be uploaded to PlayCanvas and run.

1 Like