Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Concatenating files that end in comments adds the first line of new files as comments too #184

Open
hdwebpros opened this issue Feb 15, 2018 · 0 comments

Comments

@hdwebpros
Copy link

hdwebpros commented Feb 15, 2018

npm install bootstrap
Then setup your Gruntfile with these options:

concat: {
        options: { 
          separator: ';'
        },
        modal: {
          src: ["node_modules/bootstrap/js/dist/util.js","node_modules/bootstrap/js/dist/modal.js"],
          dest: "js/modal.js"
        }
     },

Now open your modal.js file.

Look at line 139. It reads
//# 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); }

And the function _extends() gets put in with that comment.

If you edit the util.js file and add an extra line after it, the file concatenates properly, saving that function.

I'm not sure if the true fix is to force a new line after every file that ends in a comment, or fix concatenate to detect if this is true and add that new line afterwards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant