diff --git a/.github/workflows/build-push.yml b/.github/workflows/build-push.yml index de64f34..343408c 100644 --- a/.github/workflows/build-push.yml +++ b/.github/workflows/build-push.yml @@ -18,8 +18,13 @@ jobs: node-version: '15' - name: Install dependencies run: npm install + # Install workbox + - name: Install workbox + run: npm i workbox-cli --global - name: Build for production run: npm run build + - name: Build service worker + run: workbox generateSW workbox-config.js # Upload the dist directory - uses: actions/upload-artifact@master with: diff --git a/nginx.conf b/nginx.conf index 155a343..fc3a51c 100644 --- a/nginx.conf +++ b/nginx.conf @@ -23,11 +23,12 @@ http { # All the nested routes that would have atleast one dot in them # are to be served as it is. If not available, then it will # result in a 404. - location /.*\..*$ { # files (assuming they always have a dot) - root /app; - try_files $uri =404; + location ~ ^/.*\..*$ { + root /app; + try_files $uri =404; } + # All the nested routes that have something without a dot # will be redirected to the index.html location / {