Skip to content

Commit

Permalink
Debug service-worker on github pages
Browse files Browse the repository at this point in the history
  • Loading branch information
TomNUSDS committed Mar 4, 2024
1 parent 6d06eb9 commit 9867db5
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
12 changes: 6 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Website Content Editor</title>
<meta name="description" content="Markdown content editor for USDS">
<link rel="icon" href="./favicon.ico">
<link rel="apple-touch-icon" href="./apple-touch-icon.png" sizes="180x180">
<link rel="mask-icon" href="./mask-icon.svg" color="#FFFFFF">
<link rel="icon" href="favicon.ico">
<link rel="apple-touch-icon" href="apple-touch-icon.png" sizes="180x180">
<link rel="mask-icon" href="mask-icon.svg" color="#FFFFFF">
<meta name="theme-color" content="#ffffff">
<!-- this is the DESTINATION of the script when it's copied over. DO not add type="module" or vite will remove -->
<script src="./registerSW.js"></script>
<link rel="manifest" href="./manifest.webmanifest" />
<link rel="stylesheet" media="all" href="https://usds.github.io/website-staging/assets/stylesheets/styles.css" />
<link rel="manifest" href="manifest.webmanifest" />
<link rel="stylesheet" media="all" href="https://usds.github.io/website-stagingstylesheets/styles.css" />
</head>
<body id="body">
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
<script src="registerSW.js"></script>
</body>
</html>
4 changes: 2 additions & 2 deletions public/manifest.webmanifest
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "website-content-editor",
"short_name": "mdedit",
"start_url": "./",
"scope": ".",
"start_url": "/mdedit/",
"scope": "/mdedit/",
"display": "standalone",
"background_color": "#ffffff",
"lang": "en",
Expand Down
2 changes: 1 addition & 1 deletion src/service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ try {
const get_response = async (request) => {
if (request.destination !== 'image') {
// we don't cache non-images
// console.log(`cache: requests not for image "${request.url}"`, request);
console.log(`cache: requests not for image "${request.url}"`, request);
return fetch(request);
}

Expand Down
26 changes: 13 additions & 13 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ import svgr from 'vite-plugin-svgr';
import {viteStaticCopy} from "vite-plugin-static-copy";

export default defineConfig({
base: "./",
build: {
outDir: "./dist",
rollupOptions: {
output: {
manualChunks(id) {
if (id.includes("node_modules")) {
return "vendor";
}
},
},
},
},
// base: "./",
// build: {
// outDir: "./dist",
// rollupOptions: {
// output: {
// manualChunks(id) {
// if (id.includes("node_modules")) {
// return "vendor";
// }
// },
// },
// },
// },
plugins: [
react(),
// svgr "inlines" .svg so they can be easily turned into React components.
Expand Down

0 comments on commit 9867db5

Please sign in to comment.