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
Conditional compilation doesn't seem to work #119
Comments
So sorry I missed this! Thanks for the excellent writeup. Have you tried using the programmatic browserify/minifyify API? It would be good to be certain that the problem is happening in minifyify, and not in the browserify command line parsing machinery. Like you said, minifyify just passes those options on to uglify. |
I'm a command-line junky, never tried the programmatic API. Just to be sure, you're essentially saying that I should structure the build-process programmatically, but without variation? How would that be different from the cmd line? (in terms of process) thx! |
When I write and test minifyify, I do it through the programmatic browserify interface because it's less indirection. The browserify command line syntax gets nasty when the options are nested objects, and I'm a pretty careless person, so I avoid these failure points. As a result, I prefer when a bug is reproduced with the programmatic interface, so I can be sure that the fault is in minifyify, and not some typo in the command. This isn't a recommendation to ditch the command line, just a suggestion that could help us troubleshoot your problem faster. |
This problem seems to actually be coming from uglifyjs. I've been unable to use conditional compilation programmatically, but have succeeded with every other option. The only way conditional compilation has worked using the API is by providing an additional file which contains the globals used for conditional compilation tests. |
turns out that the API prop isn't "define", it's "global_defs". So the problem was my code... but also a lack of documentation from uglifyjs. I'll be fixing that. thx! |
However, it would seem that minifyify isn't handling that use-case properly via the command line. |
cool, glad you figured that out. minifyify doesn't do any options parsing, that's done by browserify. if you think that the options are being parsed wrongly you should open an issue there. |
I've written up the situation on Stackoverflow:
http://stackoverflow.com/questions/35703092/browserify-minifyify-conditional-compilation
Essentially, minifyify works really well with all other uglifyjs options, but for reasons that I can't determine, conditional compilation won't work (--compress, --dead_code --define DEBUG=false)
Any help is welcome :)
The text was updated successfully, but these errors were encountered: