Building an asset pipeline in JavaScript

all bundlers handle non-js assets. they don’t turn assets into “obfuscated js” they hash and copy them into the dist folder, so that they become fast-access cached items. bundlers are not meant for websites per se, they are asset managers. if you want to alter assets at build time then that’s what loaders are for (image-loader compresses, glsl-loader takes care of imports, etc). otherwise you’ll receive the url and the asset is still managed, typesafe and controlled. using gulp for anything would be crazy imo.

you might also want to look into react, this is the closest thing to a controlled asset pipeline you will encounter. especially gltfjsx: GitHub - pmndrs/gltfjsx: 🎮 Turns GLTFs into JSX components this solves many of the issues that are plaguing three projects.

how do i go from a blender model to a dynamic asset that can be used/animated/interacted with in my game/project: https://twitter.com/akella/status/1341811097905586178

how do i cache,
how do i re-use models,
how do i alter models without destroying the source data: reuse gltf - CodeSandbox

how do i deal with async loading,
fallbacks and level-of-detail: https://twitter.com/0xca0a/status/1358789334145658882

it handles all other loaders (textures, …) in the same manner.

1 Like