taptapship / wiredep

Wire Bower dependencies to your source code.
MIT License
1.15k stars 142 forks source link

wiredep changes absolute URLs to relative when lodash is upgraded from 2.4.1 to 3.10.X #207

Closed kylezeeuwen closed 8 years ago

kylezeeuwen commented 9 years ago

Hello, I use wiredep via grunt-wiredep to add bower dependencies to an index.html file. Upon upgrading lodash form 2.4.1 to 3.10.0 i get the following regression in the generated index.html file:

(from git diff)

     <!-- build:js /scripts/vendor.min.js -->
     <!-- bower:js -->
-    <script src="/bower_components/jquery/jquery.js"></script>
-    <script src="/bower_components/angular/angular.js"></script>
+    <script src="bower_components/jquery/jquery.js"></script>
+    <script src="bower_components/angular/angular.js"></script>

     <!-- endbower -->
     <!-- endbuild -->

As you can see absolute links have been changed to relative.

This is my grunt config (in coffee):

    wiredep:
      app:
        src: [ 'app/index.html' ]
        fileTypes:
          html:
            replace:
              js: '<script src="/{{filePath}}"></script>'
              css: '<link rel="stylesheet" href="/{{filePath}}" />'

It seems that the leading / is now being ignored. Is this a known issue , I saw several open PR that updated lodash, perhaps this sheds some light on whats breaking the travis CI builds in those PRs (https://github.com/taptapship/wiredep/pull/193)?

eddiemonge commented 8 years ago

Thats not whats breaking the tests. But you are upgrading a dependency to a breaking change so there should be some changes expected. When the dependencies do get upgraded they shouldn't change the output so some finessing might be needed

eddiemonge commented 8 years ago

I dont see this having been changed. Try vs 4.0.0 and see if its the same for you