It depends on the specific library. Until fairly recently there wasn't a language-standard way to access the global object or use modules in JavaScript. Construct is based on the modern approach of using JS Modules and globalThis for global access. Modern scripts that are based on modules should work fine. But older scripts may need tweaking to work.
For example if an old script tries to declare a global variable with var myGlobal = ..., that will need changing to globalThis.myGlobal = .... Also if the script doesn't actually export anything, you won't be able to use it with an imported name - you'll have to rely on global variables.