Skip to content

Commit

Permalink
Also support //# syntax. Fixes issue google#4.
Browse files Browse the repository at this point in the history
  • Loading branch information
cramforce committed Jun 13, 2013
1 parent 35b75ee commit b1c308b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The module provides a single function to concatenate a list of JavaScript files

![Chrome Dev Tools screen shot](http://i.imgur.com/YPc20MJ.png)

- Demo: http://jsbin.com/isozid/2/quiet
- Demo: http://jsbin.com/isozid/3/quiet
- npm: https://npmjs.org/package/concatenate-js

## When would you use it
Expand Down
4 changes: 4 additions & 0 deletions concatenate.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ module.exports = function(files, opt_wrap) {
var filename = sanitizeSingleLineComment(file.filename).replace(/^\//, '');
var hostname = sanitizeSingleLineComment(file.hostname || 'app');
var url = 'http://' + hostname + '/' + filename;
// //# is the new format. This was changed from //@ due to an
// incompatibility with IE conditional compilation. For now we support
// both.
content += '\n//# sourceURL=' + url;
content += '\n//@ sourceURL=' + url;
var js = 'eval(' + JSON.stringify(content) + ');\n';

Expand Down

0 comments on commit b1c308b

Please sign in to comment.