Navigation Menu

Skip to content

Commit

Permalink
Refactoring a bit.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffposnick committed Oct 1, 2018
1 parent a66213d commit 74416ba
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
6 changes: 2 additions & 4 deletions .gitignore
@@ -1,7 +1,5 @@
.DS_Store
.sass-cache/
/bundled/
_site/
node_modules/
.firebase
build/
firebase-debug.log
node_modules/
1 change: 0 additions & 1 deletion CNAME

This file was deleted.

2 changes: 1 addition & 1 deletion _posts/_includes/register_service_worker.njk
@@ -1,7 +1,7 @@
<script>
if ('serviceWorker' in navigator) {
window.addEventListener('load', function() {
navigator.serviceWorker.register('/sw.js');
navigator.serviceWorker.register('/service-worker.js');
});
}
</script>
4 changes: 2 additions & 2 deletions generate-sw.js
Expand Up @@ -30,15 +30,15 @@ async function generateJson() {
}

async function generateSW() {
const swDest = path.join(BUILD_DIR, 'sw.js');
const swDest = path.join(BUILD_DIR, 'service-worker.js');
const {count, size, warnings} = await workboxBuild.injectManifest({
globDirectory: BUILD_DIR,
globPatterns: [
'**/*.{json,njk}',
'index.html',
],
swDest,
swSrc: path.join('src', 'sw.js'),
swSrc: path.join('src', 'service-worker.js'),
});

for (const warning of warnings) {
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -20,6 +20,7 @@
"build": "npm run clean && eleventy && npm run copy-static && npm run generate-sw",
"clean": "fsbin remove build",
"copy-static": "fsbin copy assets build/assets && fsbin copy _posts/_data build/_posts/_data && fsbin copy _posts/_includes build/_posts/_includes",
"deploy": "npm run build && firebase deploy --only=hosting",
"generate-sw": "node generate-sw.js",
"serve": "firebase serve --only=hosting"
}
Expand Down

0 comments on commit 74416ba

Please sign in to comment.