S
S
sElijah2017-02-06 03:38:25
Grunt.js
sElijah, 2017-02-06 03:38:25

Grunt adds an extra blank line at the end of every file it receives. How to remove such behavior?

Hello. I am using grunt and the following packages:

"grunt": "^1.0.1",
"grunt-babel": "^6.0.0",
"grunt-contrib-concat": "^1.0.1",
"grunt-contrib-sass": "^1.0.0",

There are tasks:
babel: {
      dist: {
        files: [
          {
            expand: true,
            cwd: '_build/js/',
            src: [
              'app.core.js', 
              'app.util.*.js', 
              '*.js'
            ],
            dest: 'dist/assets/js/app/plugins'
          }
        ]
      }
    },
    concat: {
      app: {
        files: {
          'dist/assets/js/app/app.js': [
            'dist/assets/js/app/plugins/app.core.js',
            'dist/assets/js/app/plugins/app.util.*.js',
            'dist/assets/js/app/plugins/*.js'
          ]
        }
      },
      template: {
        files: {
          'dist/assets/js/template.js':[
            'src/js/tamplate.js'
          ]
        }
      }
    },

At the output of babel, I get *.js files, in which each last line ends with a newline (EOL), which I actually don’t need. concat and sass also add an unnecessary newline. How can I customize the behavior of grunt so that this does not happen.
I also use grunt-contrib-uglify, there, of course, there is no line ending with a newline.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question