ES6 modules + other THREE libraries

this is because you edit index.html. normally you don’t touch html files, it is not common and most bundlers will auto-generate them for you. parcel is kind of a surprise, but still, you don’t need script tags, or scripts.

you have one entry point, that’s index.js, everything is normally done from there. you can import other local js files from index.js and the bundler will include them. window.TREE could make sense in legacy codebases, otherwise it looks to me like you’re hacking the module environment.

Helpful feedback, thanks!

Hi, three.js newbie here.

I found Parcel really easy after fighting with Webpack on Windows. I followed the instructions here: https://parceljs.org/getting_started.html up to point of viewing the demo in my browser.

I added the three,js build and examples folder to the new directory.

I then copied everything between the script tags in my existing page into the new index.js file. Added the existing HTML to the new index.html and saved both.

The new HTML and JS files appeared in dist and everything worked in the browser. Each time I save the index.js file the dist files are automatically updated.

Seems easy to me but maybe it’s just that I have fairly simple use case.