grunt-bower-task icon indicating copy to clipboard operation
grunt-bower-task copied to clipboard

Not copying sub folders/files

Open davebowker opened this issue 10 years ago • 4 comments

For some reason, when I run 'grunt bower', for some dependencies, it doesn't copy everything over. For example, 'susy' -- the compass plugin. In that instance it just copies one file which tries to link to more in the subfolders which aren't there.

Here's my code:

    bower : {
        setup : {
            options : {
                cleanBowerDir : true,
                cleanTargetDir : true,
                targetDir : 'bower_components_grunt',
                layout : 'byComponent',
                install : true,
                verbose : true
            }
        }
    }

Is this a bug or am I missing something?

davebowker avatar May 31 '14 23:05 davebowker

I think I'm getting the same too, with the config from the read me, installs bower components and they don't get moved to targetDir, just sit in default /app/bower_components/

        bower: {
            install: {
                options: {
                    targetDir: './src',
                    layout: 'byType',
                    install: true,
                    verbose: true,
                    cleanTargetDir: false,
                    cleanBowerDir: false,
                    bowerOptions: {}
                }
            }
        },
Running "bower:install" (bower) task
Verifying property bower.install exists in config...OK
File: [no files]
Options: cleanTargetDir=false, cleanBowerDir=false, targetDir="./src", layout="byType", install, verbose, copy, bowerOptions={}
>> Installed bower packages
Reading /[path removed]/bower.json...OK
Parsing /[path removed]/bower.json...OK
>> Copied packages to /[path removed]/src

Done, without errors.

adamj88 avatar Jun 25 '14 20:06 adamj88

I think I am also getting this with Bootflat...

grunt-bower copying lib/Bootflat/bootflat/css/bootflat.css -> public/lib/Bootflat/bootflat.css
grunt-bower copying lib/Bootflat/bootflat/css/bootflat.css.map -> public/lib/Bootflat/bootflat.css.map
grunt-bower copying lib/Bootflat/bootflat/css/bootflat.min.css -> public/lib/Bootflat/bootflat.min.css
grunt-bower copying  dir lib/Bootflat/bootflat/scss/bootflat -> public/lib/Bootflat
grunt-bower copying lib/Bootflat/bootflat/scss/bootflat.scss -> public/lib/Bootflat/bootflat.scss
grunt-bower copying lib/Bootflat/bootflat/js/icheck.min.js -> public/lib/Bootflat/icheck.min.js
grunt-bower copying lib/Bootflat/bootflat/js/jquery.fs.selecter.min.js -> public/lib/Bootflat/jquery.fs.selecter.min.js
grunt-bower copying lib/Bootflat/bootflat/js/jquery.fs.stepper.min.js -> public/lib/Bootflat/jquery.fs.stepper.min.js
grunt-bower copying  dir lib/Bootflat/bootflat/img/check_flat -> public/lib/Bootflat

But when I look into the directory none of these files are present.

pwdonald avatar Jul 06 '14 23:07 pwdonald

I realise this is an old-ish issue, but might be worth mentioning that this issue might have to do with the library/project's bower.json specifying only 1 file as the main file as I got this in a couple of libraries also and noticed they all only list 1 main file. This seems to be the case with Susy anyway when I made a quick check. Simplest solution I found was to use what was specified in the Advanced Usage section.

kopijunkie avatar Oct 14 '14 09:10 kopijunkie

This also affects exportsOverride the following tries to copy all of the sub-folders over top of destination overwriting the destination. Only the last folder it copies makes it:

  // Doesn't work as intended
  "exportsOverride": {
    "bootstrap": {
      "/": "dist/**/*"
    }
  }

I was able to work around this issue by copying the whole folder rather than doing wildcards:

  // Works
  "exportsOverride": {
    "bootstrap": {
      "/": "dist/"
    }
  }

AaronAsAChimp avatar Jul 14 '16 18:07 AaronAsAChimp