Three Javascript injection

You can't just minify the file, you'll need to bundle everything together into a single self-contained script.

The bundler needs to resolve and inline the code from the Three.js imports and emit a single browser-compatible file.

I like Rollup.

But, my recommendation is to write a module and not do JavaScript injection. If you can understand how JavaScript injection works using the Markdown component, then you are more than qualified to write a proper module (and people around here will be more likely to help you if you're doing something supported).

3 Likes