Skip to content

Commit

Permalink
Merge pull request #48 from ShailenNaidoo/get-service-worker-to-work-…
Browse files Browse the repository at this point in the history
…with-routes-api

Get service worker to work with routes api
  • Loading branch information
shailen-naidoo authored Oct 17, 2019
2 parents f296959 + a0d8b4a commit b1cc918
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "hydrogen-cli",
"description": "Voted the world's lightest static-site generator built with TypeScript ❤ It uses 🔥 lit-html inspired templating for super duper performant template generation",
"version": "0.7.1",
"version": "0.7.2",
"author": "Shailen Naidoo",
"bin": {
"hydrogen": "./bin/run"
Expand Down
4 changes: 2 additions & 2 deletions src/services/service_worker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ const SW_DEFAULT_TEMPLATE = 'sw.js';

export const generateSW = async (sw: string | undefined = SW_DEFAULT_TEMPLATE, dev: boolean): Promise<void> => {
const [pages, swFile] = await Promise.all([
glob('pages/**/*.js'),
glob('dist/**/*.html'),
getServiceWorker(sw),
]);

const paths = pages.map((page): Path => {
const path = page.replace('pages', '').replace('.js', '.html').split('/');
const path = page.replace('dist', '').split('/');
const filename = path.pop() as string;
const route = path.join('/') || '/';

Expand Down

0 comments on commit b1cc918

Please sign in to comment.