Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minified ngxPrefetch.js is incorrect #1043

Open
vscaiceanu-1a opened this issue Oct 19, 2023 · 0 comments
Open

Minified ngxPrefetch.js is incorrect #1043

vscaiceanu-1a opened this issue Oct 19, 2023 · 0 comments

Comments

@vscaiceanu-1a
Copy link
Member

vscaiceanu-1a commented Oct 19, 2023

Setting production flag to true will result in a minified ngxPrefetch.js file.

However, the minifier is interpreting as much as possible JS in order to clean up code.

!(function () {
  var s = {
      resourceTypes: {
        image: ["png", "jpg", "gif"],
        font: ["eot", "ttf", "woff", "woff2", "svg"],
        style: ["css"],
        script: ["js"],
        document: ["html"],
      },
      crossorigin: !0,
    },
    e = "{STATICS_FULL_PATH}";
  "{STATICS_FULL_PATH}" === e && (e = "."),
    [
      "/assets/icons/icon-128x128.png",
      "/assets/icons/icon-144x144.png",
      "/assets/icons/icon-152x152.png",
      "/assets/icons/icon-192x192.png",
      "/assets/icons/icon-384x384.png",
      "/assets/icons/icon-512x512.png",
      "/assets/icons/icon-72x72.png",
      "/assets/icons/icon-96x96.png",
      "/favicon.ico",
      "/index.html",
      "/main.775825c534b8f456.js",
      "/manifest.webmanifest",
      "/polyfills.8d0e04189c01d830.js",
      "/runtime.95ebe5dfb533dd5d.js",
      "/styles.ef46db3751d8e999.css",
    ].forEach(function (n) {
      if ("string" == typeof n) {
        var i = e,
          o = n.split(".");
        (c = i + n),
          (t = (function (e) {
            if (s && s.resourceTypes)
              for (var n in s.resourceTypes)
                if (-1 !== s.resourceTypes[n].indexOf(e)) return n;
            return null;
          })(o[o.length - 1])),
          ((r = document.createElement("link")).rel = "prefetch"),
          t && (r.as = t),
          s && s.crossorigin && r.setAttribute("crossorigin", ""),
          (r.href = c),
          document.head.appendChild(r);
      }
      var c, t, r;
    });
})();
//# sourceMappingURL=ngxPrefetch.js.map
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant