-
Notifications
You must be signed in to change notification settings - Fork 9
Get glslify working with ify-loader #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Confirmed working all the way through with plotly.js. Though I never mind a second set of eyes or testing with more versions of webpack. You'll have to hook it up to this particular PR (or just add that flag manually in |
I can test webpack 1 & 2 |
tested with webpack: 2.7.0 & 1.15.0: works! |
@hughsk did you want to take a look? I'll hold off merging for 3 days to give you some time. We'll test it out on a few more transforms in the meantime. |
void main () { | ||
gl_FragColor = ones(); | ||
} | ||
, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know why this comma exists in the output, but perhaps it's nothing problematic. A large library with lots of glsl like plotly.js compiles fine, so I'm led to believe there's not a fundamental problem here. I'm going to check it off since I'm not concerned enough to investigate too deeply, but if it looks fishy to someone else, I'm glad to dig a bit.
From the browserify docs on opts:
As mentioned above, my feeling is that there are two approaches to this:
Oh, the only other issue was the type of |
@bpostlethwaite Yes, I cleaned up a couple small things. I'm content. |
It seems that
opts._flags
is empty by default. When this gets passed toglslify@5
that's fine.glslify@6
fails because that causes it to fall into the string output branch. The fix is to simply specifyopts._flags = opts._flags || []
. That causes it to function as a transform.Things to do:
[]
is the proper default foropts._flags
. (This seems not particularly important, maybe? It's a default that works fine since it's only relevant when it was unspecified and just needed to be truthy. It could befoo
and work just fine, right? But should still check.)I'm not sure it's strictly "correct", but since glslify makes the presence of
opts._flags
a hard requirement in order for it to function as a transform, it seems reasonable that it's okay to just provide that as a courtesy for all transforms.cc (and big thanks to) @bpostlethwaite @VeraZab
See also: #5, #7, #9, glslify/glslify#74