gruntjs / grunt-contrib-requirejs

Optimize RequireJS projects using r.js.
http://gruntjs.com/
MIT License
504 stars 105 forks source link

Added support for options.banner. #93

Closed nfvs closed 9 years ago

nfvs commented 9 years ago

This is implemented by overriding the options.out parameter that is passed to requirejs.optimize(). This method will prepend the banner and write the result to the output file (since requirejs does no writing when options.out is overridden).

Related to issue #58.

sindresorhus commented 9 years ago

Better done by a separate grunt task:

https://github.com/sindresorhus/grunt-header https://github.com/mattstyles/grunt-banner

nfvs commented 9 years ago

Perhaps, but I think there is an argument to be made for doing it directly in the task, since cssmin and uglify already do it without requiring additional tasks. If all we want is a simple banner similar to what those tasks already provide, I don't think using an additional task just for banners should be required.

Issue #58 also said PRs for banners would be accepted.

(I've refactored it to not require fs or path and instead use grunt.file.write())