title: What's the best Way to import Components via Link-Tag from a Package?
body: <p>Currently I import components from a package by a relative path:</p>
  
  <pre><code>&lt;link rel="components" href="packages/packageA/components/login.html"&gt;
  </code></pre>
  
  <p>However when I start nesting packages this doesn't work properly anymore. I set up a small example which can be found here: <a href="https://github.com/nikgraf/nesting-components" rel="nofollow">https://github.com/nikgraf/nesting-components</a></p>
  
  <p>When I try to build package app I get this error message:</p>
  
  <pre><code>error web/packages/packageA/components/login.html:6:5: exception while reading file         "web/packages/packageA/components/packages/packageB/components/button.html", original message:
   FileIOException: Cannot open file 'web/packages/packageA/components/packages/packageB/components/button.html' (OS      Error: No such file or directory, errno = 2)
      &lt;link rel="components" href="packages/packageB/components/button.html"&gt;
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  warning web/packages/packageA/components/login.html:12:7: custom element with tag name button not found.
        &lt;div is="button"&gt;&lt;/div&gt;
        ^^^^^^^^^^^^^^^^^     
  </code></pre>
  
  <p>Current structure:</p>
  
  <p>app
  - dependency: PackageA</p>
  
  <p>PackageA
  - dependency: PackageB</p>
  
  <p>Some Background information which might help:
  My application contains the x-login component from package A which is used by several Dart apps we build. The x-login component and in general package A contains specific code for our applications. x-login should able to use the x-button component which is in package B. Package B is a package with generic components we want to publish.</p>
  
  <p>Do you have any advice on structuring my application differently or how to import components in a better way?</p>