In my libraries.yml files the css files are linked with the relative url paths.

Eg : /css/mycss.html

So when in the page source the linked url shows as relative. How do I link those files with absolute URL path?

  • Why would you like to use absolute urls in your libraries file? – user72672 Sep 7 '18 at 8:25
  • @Jdrupal I need to render the CSS link with absolute url in the page source. For security purposes. – i am batman Sep 7 '18 at 9:03
  • Yes but if you use an absolute url like domain.com/themes/themename/css/main.css, it will only work on prod site and not on dev – user72672 Sep 7 '18 at 9:07
  • @Jdrupal is there a way to set that to get the current url or something? – i am batman Sep 8 '18 at 5:58

This is the example from the official documentation, notice this bit type: external:

  remote: https://github.com/angular/angular.js
  version: 1.4.4
    name: MIT
    url: https://github.com/angular/angular.js/blob/master/LICENSE
    gpl-compatible: true
    https://ajax.googleapis.com/ajax/libs/angularjs/1.4.4/angular.min.js: { type: external, minified: true }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.