Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Merge requests
  • !25637

New lines to the end of JS dist files for better concatenating compatibility

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/hdwebpros/v4-dev into v4-dev Feb 15, 2018
  • Overview 0
  • Commits 1
  • Pipelines 0
  • Changes 12

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.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/hdwebpros/v4-dev