You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
826 B
27 lines
826 B
3 years ago
|
<!DOCTYPE html>
|
||
|
<html>
|
||
|
<head>
|
||
|
<meta charset="utf-8" />
|
||
|
<title>Webpack App</title>
|
||
|
</head>
|
||
|
<body>
|
||
|
<h1>Hello world!</h1>
|
||
|
<h2>Tip: Check your console</h2>
|
||
|
</body>
|
||
|
<% if (workboxWebpackPlugin) { %>
|
||
|
<script>
|
||
|
if ("serviceWorker" in navigator) {
|
||
|
window.addEventListener("load", () => {
|
||
|
navigator.serviceWorker
|
||
|
.register("service-worker.js")
|
||
|
.then((registration) => {
|
||
|
console.log("Service Worker registered: ", registration);
|
||
|
})
|
||
|
.catch((registrationError) => {
|
||
|
console.error("Service Worker registration failed: ", registrationError);
|
||
|
});
|
||
|
});
|
||
|
}
|
||
|
</script><% } %>
|
||
|
</html>
|