ebeaufay / threedtiles

3DTiles viewer for three.js
MIT License
270 stars 32 forks source link

The project is for bowser or Nodejs? #5

Closed easyfrog closed 2 years ago

easyfrog commented 2 years ago

I go an error:

image

I see the code like require('path') in source. So is this project only for nodejs?

image
ebeaufay commented 2 years ago

Project is definitely for web browser but I guess require isn't available by default on browsers indeed. I use webpack which I guess automatically converts it.

I'll check if I can convert the require to an import

ebeaufay commented 2 years ago

So webpack makes require available automatically. If you don't want to use webpack, you can include this library in your project

require-browser

I'll still try to remove the dependency on path which is used for url formatting

ebeaufay commented 2 years ago

Ok I fixed it by replacing const path = require('path') with *import as path from "path-browserify"**