btford / grunt-google-cdn

58 stars 50 forks source link

Issue on components path on Windows #39

Open laurent-le-graverend opened 11 years ago

laurent-le-graverend commented 11 years ago

https://github.com/btford/grunt-google-cdn/blob/master/tasks/cdnify.js#L18

    var bowerDirBits = bowerConfig.directory.split(path.sep);
    // here for me bowgetDirBits = [ 'app/components' ]
    // and path.sep = "\\"
    var componentsPath = bowerDirBits.join(path.sep);
    // this obsiously is empty

It is maybe not good to rely on path.sep on Windows because of the backslashes.

whyleee commented 9 years ago

I confirm this issue is reproduced if "directory" setting in .bowerrc has path with "/" slashes in Windows. split should be done by any type of slash.

And what's the reason of this chunk of code anyway?

  1. Suppose I have bower components in "app/components" dir
  2. My original script src: "/app/components/jquery/dist/jquery.js"
  3. Replaced by grunt task to: "/app//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js" which is a broken URL.