Use OBJLoader as a non ES6 Module?

How can I use OBJLoader in my project without using ES6 Modules but the oldschool way? Since it’s not inside the main three.js script… I’m not familiar with es6 Modules and don’t plan on using them…

the old way is about to get deleted, three/examples/js will fall out soon. besides, there really is no point to struggle with this stuff any longer, weekends spent on figuring out how to use a bit of code just seems weird these days when everything is about sharing and re-use via modules. get a bundler npm install three, npm run start and you can code with more comfort and ease than you have ever known.

I got it working by removing all the imports in and added THREE infront of the imported classes.

But I guess I will have to learn modules now.

To bad I’d like to keep my project overhead as low as possible…
Vite js will not work with my project because I need a server.js file and handle requests manually along with websockets and database conections and more…

What whill hapen to the examples? Will they get integrated into one script? Or will there be no one script and everything is breaked down into modules?

The examples already use the “new” way. Meaning they include ES6 modules and not global scripts lie before.

The usage of a bundler is recommended but not mandatory. It will always be possible to use workflows without bundlers by directly import modules into your HTML page.

There is no fixed date for the removal of examples/js. It depends on how fast Firefox and Safari support import maps.

this is like the most common thing in the world, databases and sockets. vite just builds the client, the server is untouched by any of it, your server.js remains the way it is. there are also whole solutions like nextjs and so on. i didn’t intend to be contrarian, i’m just saying, the IIFE stuff is already dead, three may still have it, but when it goes it sends your project into turmoil.

Im porting over my project to modules now.
There were some obsticals like authentification and webworkers but I think im getting the hang of it slowly.
I had a query parameter for checking wether the client gets a file. But now I figured out that cookies are passed in the http header when I use an import. So I can check that instead now.

I tried the vite js example but there was no server js and it somehow worked. So I guess I need to dig into it more into it.