The format is surely caused by the fact that multiline template literals were not available or not available for all browsers ( Internet Explorer ) when originally created.
The changeover takes a lot of effort, but is possible in sections. Is anything planned in this regard in the near future
I will, as I delve further into the shader now, rewrite the parts needed. Possibly these code snippets are useful?
I started with this in my local version import * as THREE from '../jsm/three.module.136.TEST.js';
and it works.
Not sure what your question is exactly. But IMO there are three flavours to work with formatted/readable shadercode which are sufficiant and provides enough ways to do this:
Import from text file (with an extension like .frag or .vert or .glsl or custom) with something like fetch() so you can just format however you like and even use IDE formatting for GLSL. After import you just feed that imported text to the shader of choice.
Use the template literals with the ticks like you did in the bottom part of your post if you like to have shadercode inline inside your javascript file
Put the shader code inbetween html tags and read that html tags’ inner html
If it’s just to be able to read or copy them to adjust, these shaderchunks and shaderlib code parts are just ‘compiled’ versions of the original shaderchunk files AFAIK:
In the current form in code they are also way smaller in file size than to have them formatted as template literals. To have readable code there wouldn’t make any sense in production.
This is much easier if they are easy to read.
Therefore I have transformed a small piece (defaultnormal_vertex) from the original representation to try.