Skip to content
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

Support Uglify's wrap and define features #12

Closed
dylang opened this issue Dec 23, 2012 · 1 comment
Closed

Support Uglify's wrap and define features #12

dylang opened this issue Dec 23, 2012 · 1 comment

Comments

@dylang
Copy link
Contributor

dylang commented Dec 23, 2012

Until mishoo/UglifyJS#33 is closed there are still some other options that would be helpful to support.

Wrap will wrap your code within a closure, helpful to make sure no functions are leaking into the global scope.

Define will define variables in the closure which provides an easy way to hardcode in the JS data like the the build date, version, and debug information.

@dylang
Copy link
Contributor Author

dylang commented Dec 24, 2012

Figured out that define is already supported, just not well documented.

                compress: {
                    drop_debugger: false,   // don't remove debugger;
                    warnings: false,        // don't show any warnings
                    global_defs: {
                        DEBUG: true
                    }
                }

Closing this because I have a pull request in for wrap support.

@dylang dylang closed this as completed Dec 24, 2012
joeldenning added a commit to joeldenning/grunt-contrib-uglify that referenced this issue Jan 25, 2016
Having read uglifyjs' documentation, I came to this repo looking for how to use the equivalent of the `--define` command line option. I almost was unable to find how to do so, but gruntjs#12 saved me, indicating that the documentation was just not great on how to use this feature.

So this change would hopefully just help people like me who searched the page for `--define` and didn't know what to do when they couldn't find it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant