JS shader file

hi,

Is there any way I can put a shader code snippet to a separate js file? I have tried to replace the following code

<script id=“shader-fs” type=“x-shader/x-fragment”>
#ifdef GL_ES
precision highp float;
#endif

void main(void) {
    gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);
}

</script>

By


<script id=“shader-fs” type=“x-shader/x-fragment” src=“fragment.js”></script>

But I got errors. Any suggestion?