NPM Dependencies
Currently, GodotJS
doesn't provide sufficient support for using code from npm packages. Because many factors are involved in it, such as:
- Scripts depend on functionalities of node.js which is not supported
- How the typescript/javascript project is packaged (archive into a single script file or not)
- Javascript modular standard variants may be involved
Workaround as bundle
Try to bundle npm dependencies to an own file to avoid potential conflicts.
If you use godot-ts you can create a *.bundle.ts
file like this:
```ts npm.bundle.ts export { default as dayjs } from "dayjs";