message: Deps Index uses the baseUrl from the analyzer's parsedDocument.
diff: */
  import {AssertionError} from 'assert';
  import {Analyzer} from 'polymer-analyzer';
  +import * as urlLib from 'url';
  +import * as urlUtils from './url-utils';
  import {UrlString} from './url-utils';
  export interface DepsIndex {
  // An index of entrypoint -> html dependencies
  - entrypointToDeps: Map<string, Set<string>>;
  + entrypointToDeps: Map<UrlString, Set<UrlString>>;
  }
  type DependencyMapEntry = {
  @@ -33,11 +35,12 @@ async function _getTransitiveDependencies(
  url: UrlString, entrypoints: UrlString[], analyzer: Analyzer):
  Promise<DependencyMapEntry> {
  const document = await analyzer.analyze(url);
  + const documentBase = document.parsedDocument.baseUrl;
  const imports = document.getByKind(
  'import', {externalPackages: true, imported: true});
  const eagerImports = new Set<UrlString>();
  const lazyImports = new Set<UrlString>();
  - for (let htmlImport of imports) {
  + for (const htmlImport of imports) {
  try {
  console.assert(
  htmlImport.url, 'htmlImport: %s has no url', htmlImport);
  @@ -47,12 +50,14 @@ async function _getTransitiveDependencies(
  }
  throw err;
  }
  + const resolvedHtmlImportUrl = urlLib.resolve(
  + documentBase, urlUtils.relativeUrl(documentBase, htmlImport.url));
  switch (htmlImport.type) {
  case 'html-import':
  - eagerImports.add(htmlImport.url);
  + eagerImports.add(resolvedHtmlImportUrl);
  break;
  case 'lazy-html-import':
  - lazyImports.add(htmlImport.url);
  + lazyImports.add(resolvedHtmlImportUrl);
  break;
  }
  }
  @@ -61,10 +66,10 @@ async function _getTransitiveDependencies(
  export async function buildDepsIndex(
  entrypoints: UrlString[], analyzer: Analyzer): Promise<DepsIndex> {
  - const entrypointToDependencies: Map<string, Set<string>> = new Map();
  - const dependenciesToEntrypoints: Map<string, Set<string>> = new Map();
  + const entrypointToDependencies: Map<UrlString, Set<UrlString>> = new Map();
  + const dependenciesToEntrypoints: Map<UrlString, Set<UrlString>> = new Map();
  const queue = Array.from(entrypoints);
  - const visitedEntrypoints = new Set<string>();
  + const visitedEntrypoints = new Set<UrlString>();
  while (queue.length > 0) {
  const entrypoint = queue.shift()!;
  if (visitedEntrypoints.has(entrypoint)) {
  