Created by: hdwebpros
Many tools misbehave if the last line of data in a text file is not terminated with a newline or carriage return / new line combination. They ignore that line as it is terminated with ^Z (eof) instead.
I ran into an issue using NPM to install Bootstrap and cherrypicking a few components to use on a project. When I concatenated with Grunt, I ran into all sorts of issues. Mainly, a comment like //# sourceMappingURL=util.js.map
would be the last line of the utils.js file for example, and then the function from the first line of the next file in the concatenation process would end up as a comment as well.
Here's an example of the combined comment and function:
//# sourceMappingURL=util.js.map;function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
Adding a new line to the end of the JS files fixes this issue.
I added these manually. If there is a process that generates these files, then I'd assume the fix has to go there instead. I'm kind of a novice at this pull request business, but hopefully, I helped.