3

My concat Task Output is empty, I don't understand it. my Gruntfile:

module.exports = function(grunt) {

    // Project configuration.
    grunt.initConfig({
        concat: {
            dist: {
                src: 'src/js/*.js',
                dest: 'js/main.js'
            }
        }
    });
    // Load Tasks
    grunt.loadNpmTasks('grunt-contrib-concat');

    // Default task.
    grunt.registerTask('default', 'concat');

};

grunt v0.4.5 npm v1.3.14

I use grunt concat and get the following message:

Running "concat:dist" (concat) task
File js/main.js created.

Done, without errors.

But the Outputfile main.js is empty.

Here is my package.json:

{
  "name": "Testing",
  "version": "0.0.0",
  "description": "",
  "main": "Gruntfile.js",
  "dependencies": {
    "bower": "~1.3.12",
    "express": "~4.10.2",
    "grunt-concat-include": "~0.2.4",
    "grunt-cli": "~0.1.13",
    "grunt-contrib": "~0.11.0",
    "grunt": "~0.4.5",
    "grunt-contrib-compass": "~0.7.2",
    "grunt-contrib-coffee": "~0.10.1",
    "grunt-contrib-compress": "~0.8.0",
    "grunt-contrib-connect": "~0.9.0",
    "grunt-contrib-concat": "~0.5.0",
    "grunt-contrib-csslint": "~0.2.0",
    "grunt-contrib-cssmin": "~0.9.0",
    "grunt-contrib-handlebars": "~0.8.0",
    "grunt-contrib-htmlmin": "~0.2.0",
    "grunt-contrib-imagemin": "~0.7.2",
    "grunt-contrib-jade": "~0.11.0",
    "grunt-contrib-jasmine": "~0.6.5",
    "grunt-contrib-clean": "~0.5.0",
    "grunt-contrib-jst": "~0.6.0",
    "grunt-contrib-copy": "~0.5.0",
    "grunt-contrib-jshint": "~0.10.0",
    "grunt-contrib-less": "~0.11.4",
    "grunt-contrib-requirejs": "~0.4.4",
    "grunt-contrib-qunit": "~0.4.0",
    "grunt-contrib-nodeunit": "~0.3.3",
    "grunt-contrib-sass": "~0.7.4",
    "grunt-contrib-uglify": "~0.4.1",
    "grunt-contrib-stylus": "~0.15.1",
    "grunt-contrib-yuidoc": "~0.5.2",
    "grunt-contrib-symlink": "~0.3.0",
    "grunt-contrib-watch": "~0.6.1",
    "grunt-dev-update": "~1.0.1",
    "grunt-express-server": "~0.4.19",
    "min": "~0.0.4"
  },
  "devDependencies": {},
  "scripts": {
    "test": "test"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/gruntjs/grunt"
  },
  "author": "me",
  "license": "BSD-2-Clause",
  "bugs": {
    "url": "https://github.com/gruntjs/grunt/issues"
  },
  "homepage": "https://github.com/gruntjs/grunt"
}
ferdynator
  • 6,245
  • 3
  • 27
  • 56

1 Answers1

0

The most likely cause for this is incorrect source paths. Everything must be relative from the location of the Gruntfile. In your case my guess would be that your Gruntfile resides inside of your src, so you need to change your config from:

concat: {
            dist: {
                src: 'src/js/*.js',
                dest: 'js/main.js'
            }
        }

to:

concat: {
            dist: {
                src: 'js/*.js',
                dest: 'js/main.js'
            }
        }
BlackSpy
  • 5,563
  • 5
  • 29
  • 38