javascriptconfigurationgruntjsbowergruntfile

Grunt 'grunt-bower-concat', ignoring mainFiles option


Well met!

For the past hours I have been trying to get the mainFiles option to work, but it seems to ignore every file that I include in there. I have tried multiple plugins in the list- but none of them get through. I am rather new with Grunt, admittedly, but I have been going through the grunt-bower-concat documentation but, nothing there. And have been adding a number of console logs inside the actual plugin code, shows no files are being passed (reverted the file after, of course).

This is the GruntFile I'm working with:

  module.exports = function(grunt) {

  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    bower_concat: {
      main: {
        dest: 'Assets/Build/Scripts/plugins.js',
        cssDest: 'Assets/Build/Styles/plugins.css',
        dependencies: {
          'amplify': 'jquery'
        },
        mainFiles: {
          bootstrap: ['bower_components/bootstrap/dist/css/bootstrap.css']
        },
        exclude: [
          'leaflet-illustrate'
        ]
      }
    }
  });

  grunt.loadNpmTasks('grunt-bower-concat');

  grunt.registerTask('buildbower', ['bower_concat']);

};

Leaflet-Illustrate has been excluded (for now) because it wreaks havoc on the actual task, and without the mainFiles option, I can't include it correctly.

Is there anyone who can direct me in the right way, or correct me? Thanks in advance!


Solution

  • As it turns out, I entered a full path which was not needed. Meaning, this part works:

      main: {
        mainFiles: {
          'bootstrap': ['dist/css/bootstrap.css']
        }