This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Getting and Creating Projects |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "angular-rental-app", | |
"short_name": "angular-rental-app", | |
"theme_color": "#1976d2", | |
"background_color": "#fafafa", | |
"display": "standalone", | |
"scope": "./", | |
"start_url": "./", | |
"icons": [ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { fileURLToPath, URL } from "node:url"; | |
import { VitePWA } from "vite-plugin-pwa"; | |
import { defineConfig } from "vite"; | |
import vue from "@vitejs/plugin-vue"; | |
// https://vitejs.dev/config/ | |
export default defineConfig({ | |
plugins: [ | |
vue(), | |
VitePWA({ | |
registerType: "autoUpdate", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "./node_modules/@angular/service-worker/config/schema.json", | |
"index": "/index.html", | |
"assetGroups": [ | |
{ | |
"name": "app", | |
"installMode": "prefetch", | |
"resources": { | |
"files": [ | |
"/favicon.ico", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//This is a service worker script that caches specific URLs for offline use and handles network requests when the internet connection is not available. | |
// We give a name to our cache, so we can refer to it later. | |
const CACHE_NAME = "version-1"; | |
// These are the URLs that we want to cache. | |
const urlsToCache = ["index.html", "offline.html"]; | |
// We call the 'self' object, which refers to the Service Worker itself. | |
const self = this; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |
<meta name="theme-color" content="#000000" /> | |
<meta name="description" content="Rentals App" /> | |
<meta name="author" content="Rental App" /> | |
<meta name="keywords" content="rental, app, rentals app" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { build, files } from '$service-worker'; | |
const worker = self; | |
const STATIC_CACHE_NAME = 'cache-v1'; | |
const APP_CACHE_NAME = 'offline-v1'; | |
const CACHE_NAMES = [STATIC_CACHE_NAME, APP_CACHE_NAME]; | |
const version = 'v1'; | |
// hard-coded list of app routes we want to preemptively cache | |
const routes = ['/']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="theme-color" content="#000000" /> | |
<meta name="description" content="Rentals App" /> | |
<meta name="author" content="Rental App" /> | |
<meta name="keywords" content="rental, app, rentals app" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "application name", // sets the name of the app | |
"short_name": "short name application", // sets a shorter name of the app | |
"theme_color": "#1976d2", // determines the primary color scheme used by the app | |
"background_color": "#fafafa", // sets the background color behind the app when it is launched | |
"display": "standalone", // determines how the app is displayed to users | |
"scope": "./", // specifies the base URL for the app and restricts its access to specific folders | |
"start_url": "./", // specifies the URL where the app should start when launched from the user's home screen or app launcher | |
"icons": [ // contains an array of objects specifying the icons used for the app | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @type {import('next').NextConfig} */ | |
const withPWA = require("next-pwa")({ | |
dest: "public", // output directory | |
register: true, // register pwa | |
skipWaiting: true, // skip waiting for old service worker to be disabled | |
disable: process.env.NODE_ENV === "development", // disable in development | |
runtimeCaching: [ | |
//cache assets & data from external api | |
{ |
OlderNewer