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

Add ability to prepend comments without mangling sourcemaps #335

Closed
jsoverson opened this issue Oct 29, 2013 · 2 comments
Closed

Add ability to prepend comments without mangling sourcemaps #335

jsoverson opened this issue Oct 29, 2013 · 2 comments

Comments

@jsoverson
Copy link

There's been a use case that has come up as part of grunt-contrib-uglify (#22 where different banners need to be appended to the minified and unminified files.

This case isn't really covered by the --comments flag unless the banner is appended beforehand to an intermediate file which is cumbersome and souremaps get broken if appended after uglification.

Any chance of getting this option?

@mishoo
Copy link
Owner

mishoo commented Oct 29, 2013

I added it as a parameter to the code generator. If you're using UglifyJS.minify function, you can pass for example:

output: {
    preamble: "// (c) ACME"
}

A newline will be added after the preamble if one is not there already.

@jsoverson
Copy link
Author

Thanks @mishoo

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

2 participants