Git Product home page Git Product logo

Comments (11)

curist avatar curist commented on September 26, 2024

Just tested with the config you provided.
Except package specified destination doesn't work, the rest works as expected.

Using your config and run grunt bower, I got the following structure:

.tmp
└── public
    ├── css
    │   └── bootstrap
    │       └── bootstrap.css
    └── fonts
        ├── bootstrap.js
        ├── glyphicons-halflings-regular.eot
        ├── glyphicons-halflings-regular.svg
        ├── glyphicons-halflings-regular.ttf
        └── glyphicons-halflings-regular.woff

from grunt-bower.

Kuirak avatar Kuirak commented on September 26, 2024

strange because it is copying the complete bower_components/dist tree aditionally e.g:
.tmp\public\js\components\bower_components\bootstrap\dist\js\bootstrap.js
.tmp\public\js\components\bootstrap.js

my complete task looks like:

grunt.config.set('bower', {
        dev: {
            dest: '.tmp/public',
            js_dest: '.tmp/public/js/components',
            css_dest: '.tmp/public/styles/components',
            options: {
                packageSpecific: {
                    bootstrap: {
                        files: [
                            "./dist/js/bootstrap.js",
                            "./dist/css/bootstrap.css",
                            "./dist/fonts/glyphicons-halflings-regular.eot",
                            "./dist/fonts/glyphicons-halflings-regular.svg",
                            "./dist/fonts/glyphicons-halflings-regular.ttf",
                            "./dist/fonts/glyphicons-halflings-regular.woff"
                        ],
                        dest: '.tmp/public/fonts',
                        css_dest: '.tmp/public/css/bootstrap'
                    }
                }
            }
        }
    });

    grunt.loadNpmTasks('grunt-bower');

from grunt-bower.

curist avatar curist commented on September 26, 2024

Duh.. still can't reproduce it.
Will look into this again later.

from grunt-bower.

Kuirak avatar Kuirak commented on September 26, 2024

Ok , no problem, i put bootstrap in manually for now. Tell me if you need anything else.

from grunt-bower.

curist avatar curist commented on September 26, 2024

Please use this gist https://gist.github.com/curist/10078523 and see if you still have this problem.

from grunt-bower.

jooyunghan avatar jooyunghan commented on September 26, 2024

I had this problem and figured it out.
grunt-bower/tasks/lib/helpers.js line 50 and its 'else' part doesn't path.join with components_path
I patched as following:

if(typeof main_path === 'string') {
    main_path = path.join(components_path, main_path);
...
} else {
    // array, falling through
    main_path = main_path.map(function(file) {
      return path.join(components_path, file);
    });
    return main_path;
  }

Also, make sure .bowerrc's directory ends with /. Otherwise bower.commands.list will generate quite weird relative paths (with duplicate of last part of path).

from grunt-bower.

curist avatar curist commented on September 26, 2024

Eh, that's weird.
The main_path is passed from bower.command.list, and it's the full path to the files.
What's the result of bower list --paths?

And about the .bowerrc's directory issue, I tested both with or without /, all runs fine for me.
Are you guys running a windows machine?

from grunt-bower.

jooyunghan avatar jooyunghan commented on September 26, 2024

I was wrong about a trailing slash issue. I found 'bower list --path' issue bower/bower#928
For me bower.commands.list 's result list contains inappropriate paths then causes copy failure.

from grunt-bower.

curist avatar curist commented on September 26, 2024

That seems to nailed it, will think about how to deal with it.
Thanks for reporting this!

from grunt-bower.

jooyunghan avatar jooyunghan commented on September 26, 2024

I work around that by passing options with 'relative : false'.

On Wed, Apr 9, 2014 at 12:05 PM, Curtis Chang [email protected]:

That seems to nailed it, will think about how to deal with it.
Thanks for reporting this!


Reply to this email directly or view it on GitHubhttps://github.com//issues/20#issuecomment-39924507
.

Jooyung Han

from grunt-bower.

curist avatar curist commented on September 26, 2024

Yea, that works. Thanks!

from grunt-bower.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.