gatsby-link
Advanced tools
Comparing version 1.0.0-alpha12-alpha.bdc68bfd to 1.0.0-alpha12-alpha.faff3fa9
31
index.js
@@ -29,27 +29,22 @@ "use strict"; | ||
}, | ||
componentDidMount: function componentDidMount() { | ||
var _this = this; | ||
// Only enable prefetching of Link resources in production and for browsers that | ||
// don't support service workers *cough* Safari/IE *cough*. | ||
if (process.env.NODE_ENV === "production" && !("serviceWorker" in navigator)) { | ||
(function () { | ||
var routes = window.gatsbyRootRoute; | ||
var routes = window.gatsbyRootRoute; | ||
var _require = require("history"), | ||
createMemoryHistory = _require.createMemoryHistory; | ||
var _require = require("history"), | ||
createMemoryHistory = _require.createMemoryHistory; | ||
var matchRoutes = require("react-router/lib/matchRoutes"); | ||
var getComponents = require("react-router/lib/getComponents"); | ||
var matchRoutes = require("react-router/lib/matchRoutes"); | ||
var getComponents = require("react-router/lib/getComponents"); | ||
var createLocation = createMemoryHistory().createLocation; | ||
var createLocation = createMemoryHistory().createLocation; | ||
if (typeof routes !== "undefined") { | ||
matchRoutes([routes], createLocation(_this.props.to), function (error, nextState) { | ||
getComponents(nextState, function () { | ||
return console.log("loaded assets for " + _this.props.to); | ||
}); | ||
}); | ||
} | ||
})(); | ||
if (typeof routes !== "undefined") { | ||
matchRoutes([routes], createLocation(this.props.to), function (error, nextState) { | ||
getComponents(nextState, function () { | ||
return console.log("loaded assets for " + _this.props.to); | ||
}); | ||
}); | ||
} | ||
@@ -56,0 +51,0 @@ }, |
{ | ||
"name": "gatsby-link", | ||
"version": "1.0.0-alpha12-alpha.bdc68bfd", | ||
"version": "1.0.0-alpha12-alpha.faff3fa9", | ||
"description": "An enhanced Link component for Gatsby sites with support for resource prefetching", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
1
4204
40