Pro License user here.
I am using needle.min.js pretty much grabbed from the CDN included in the project. I’d like to use it along with external typescript scripts.
Im my scenario I have bunch of glb files I’d like present. I’d unrealistic to setup a project for each one and have them built and deployed separately.
So I’d like to use needle.min.js along with external scripts.
I’ve tried to use the following code but it doesn’t work. I have working scripts
folder and I just would like to inject them into context after loading glb file. So my code atm looks like this:
<script lang="ts">
import "./needle.min"; /// needle.min.js from CDN
// now I know that `Needle` namespace is available in window object so I can inject scripts
// but i'm not sure how to do it atm
console.log(window.Needle);
const src: string =
"https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/DamagedHelmet/glTF-Embedded/DamagedHelmet.gltf";
</script>
<!-- needle webcomponent -->
<needle-engine {src}></needle-engine>
Idea is to use <needle-engine>
webcomponent and inject external scripts into context on top of it, prefferably with Typescript as well.
We do plan to have scripts distributed among rest of the team in private npm package but for now I’d like to keep it simple and test waters if it’s possible to make it work