Created
April 23, 2015 14:10
-
-
Save ryanflorence/3024fa7e30a091ff8ea0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// I'll have a entry point for the server app, like server.js, | |
// and and entry for the client app, like client.js | |
// in server.js I do this: | |
IS_CLIENT = false; | |
// in client.js I do this: | |
IS_CLIENT = true; | |
// Then anywhere in your code you can do this: | |
if (IS_CLIENT) { | |
doStuff(); | |
} | |
// and then uglifyjs dead code eliminiation on client.js will see | |
// stuff like this | |
if (false) { | |
doStuff(); | |
} | |
// and wipe it out |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment