I am writing a simple Javascript library that uses some WebGL code. I would like to include the inline shader sources in the .js file because my alternatives should include them as script tags on each page or have them as separate files that load as AJAX. None of these options are particularly modular. However, due to the lack of multi-line strings in javascript, I have no good ideas on how to embed WebGL code. Is there an approach that I don't think about?
source
share