fenomas / noa

Experimental voxel game engine.
MIT License
608 stars 86 forks source link

Fix errors when using loaders other than `WebPack` #178

Closed Codezilluh closed 2 years ago

Codezilluh commented 2 years ago

require.context doesn't exist in (somewhat superior) compilers like Parcel.

This was causing errors. I tried to fix in a clean and simple way, but hardcoding it was the only viable option. Should still work with WebPack, but now can also be used in Parcel

TheToto commented 2 years ago

With parcel, i've used

var reqContext = require('../components/*.js') 

with @parcel/resolver-glob resolver plugin.

But that's not a standard either.

fenomas commented 2 years ago

Hi, thanks for reporting this and sorry for letting it sit. Doing these as manual imports is long overdue.

I will move this over to the #develop branch and then merge it, thanks! (And afterwards change some stylistic things, etc.)