craigspaeth / nap

Compile, manage, & package stylesheets, javascripts, and javascript templates for node.js
MIT License
122 stars 33 forks source link

Add new-lines between concatenated files #62

Closed dirkmc closed 11 years ago

dirkmc commented 11 years ago

I needed to change this line:

contents = (contents for fn, contents of preprocessPkg pkg, 'js').join('')

to this:

contents = (contents for fn, contents of preprocessPkg pkg, 'js').join('\n')

because if the previous file had no new line at the end of it then concatenating files sometimes created invalid javascript

craigspaeth commented 11 years ago

Seems fine to me, I'll accept a PR with a test for it.

However, shouldn't it be concatenated with semi-colons instead because minifying would remove the whitespace anyways? Or maybe uglify already covers this issue. Either way I don't see any harm in joining with a newline.

dirkmc commented 11 years ago

I'll write a test and try it with uglify, and submit a pull request. Thanks

dirkmc commented 11 years ago

Fixed in pull request https://github.com/craigspaeth/nap/pull/63

craigspaeth commented 11 years ago

Fixed between these two commits https://github.com/craigspaeth/nap/compare/0f291d7fc59e5f9e21dc0f574eb6209d4b2c3e3e...master, thanks for the help!

dirkmc commented 11 years ago

Oops :) Thanks for the quick fix!