glslify / rollup-plugin-glslify

Import GLSL strings with glslify

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compression converts `else if` to `elseif`

micahjon opened this issue · comments

Hi, I noticed that compressing this shader code:

    }else
    if (mode == 1.0){ // GROW

        offsetStrength *= 0.25;

Results in the following string:
}elseif(mode==1.0){offsetStrength*=0.25;

Where else if is converted to elseif

I'm guessing this is unintentional. My understanding is that elseif is not valid syntax for GLSL, or at least not widely supported. Thanks for looking into this.

Hi, this would be an upstream issue as the logic is from rollup-plugin-glsl.

If you're determined to resolve the issue you can create an issue there, or remove the newline so else if is on one line.

Upstream issue vwochnik/rollup-plugin-glsl#6 for reference.