externalize() {
    let urlObj;
    if (typeof this._path === 'string') {
      urlObj = new urlModule.URL(
        this.assetGraph.root + this._path.replace(/^\//, '')
      );
    } else {
      urlObj = new urlModule.URL(this.assetGraph.root);
    }
    for (const urlPropertyName of [
      'username',
      'password',
      'hostname',
      'port',
      'protocol',
    ]) {
      const value = this[`_${urlPropertyName}`];
      if (typeof value !== 'undefined') {
        urlObj[urlPropertyName] = value;
      }
    }

    let baseName;
    let extension;
    if (typeof this._fileName === 'string') {
      extension = pathModule.extname(this._fileName);
      baseName = pathModule.basename(this._fileName, extension);
    } else {
      baseName = this.baseName || this.id;
      extension = this.extension;
      if (typeof extension === 'undefined') {
        extension = this.defaultExtension;
      }
    }
    if (this._query) {
      urlObj.search = this._query;
    }
    const pathnamePrefix = urlObj.pathname.replace(/\/+[^/]+$/, '/') || '/';
    urlObj.pathname = pathnamePrefix + baseName + extension;
    this.url = urlObj.toString();
  }
Externalize an inlined Asset.

This will create an URL from as many available URL parts as possible and
auto generate the rest, then assign the URL to the Asset