├── .browserslistrc ├── .firebaserc ├── .gitignore ├── README.md ├── babel.config.js ├── firebase.json ├── package-lock.json ├── package.json ├── postcss.config.js ├── public ├── favicon.ico ├── firebase-messaging-sw.js ├── img │ └── icons │ │ ├── android-chrome-192x192.png │ │ ├── android-chrome-512x512.png │ │ ├── apple-touch-icon-120x120.png │ │ ├── apple-touch-icon-152x152.png │ │ ├── apple-touch-icon-180x180.png │ │ ├── apple-touch-icon-60x60.png │ │ ├── apple-touch-icon-76x76.png │ │ ├── apple-touch-icon.png │ │ ├── favicon-16x16.png │ │ ├── favicon-32x32.png │ │ ├── msapplication-icon-144x144.png │ │ ├── mstile-150x150.png │ │ └── safari-pinned-tab.svg ├── index.html ├── manifest.json └── robots.txt ├── src ├── App.vue ├── assets │ └── logo.png ├── components │ └── HelloWorld.vue ├── main.ts ├── registerServiceWorker.ts ├── router.ts ├── shims-tsx.d.ts ├── shims-vue.d.ts ├── store.ts └── views │ ├── About.vue │ └── Home.vue ├── tsconfig.json └── tslint.json /.browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions 3 | not ie <= 8 4 | -------------------------------------------------------------------------------- /.firebaserc: -------------------------------------------------------------------------------- 1 | { 2 | "projects": { 3 | "default": "vue-pwa-tutorial" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Editor directories and files 15 | .idea 16 | .vscode 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | *.sw* 22 | 23 | .firebase -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vue-pwa-tutorial 2 | Document 3 | 4 | Vue CLI 3 で PWA やってみた(Service Workers / Add to Home Screen / Push Notifications) 5 | https://qiita.com/n11sh1/items/5d64c337ef927ac8d5d6 6 | 7 | ## Project setup 8 | ``` 9 | npm install 10 | ``` 11 | 12 | ### Compiles and hot-reloads for development 13 | ``` 14 | npm run serve 15 | ``` 16 | 17 | ### Compiles and minifies for production 18 | ``` 19 | npm run build 20 | ``` 21 | 22 | ### Run your tests 23 | ``` 24 | npm run test 25 | ``` 26 | 27 | ### Lints and fixes files 28 | ``` 29 | npm run lint 30 | ``` 31 | 32 | ### Customize configuration 33 | See [Configuration Reference](https://cli.vuejs.org/config/). 34 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/app' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /firebase.json: -------------------------------------------------------------------------------- 1 | { 2 | "hosting": { 3 | "public": "dist", 4 | "ignore": [ 5 | "firebase.json", 6 | "**/.*", 7 | "**/node_modules/**" 8 | ], 9 | "rewrites": [ 10 | { 11 | "source": "**", 12 | "destination": "/index.html" 13 | } 14 | ] 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue-pwa-tutorial", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build", 8 | "lint": "vue-cli-service lint" 9 | }, 10 | "dependencies": { 11 | "firebase": "^5.8.0", 12 | "register-service-worker": "^1.5.2", 13 | "vue": "^2.5.21", 14 | "vue-class-component": "^6.0.0", 15 | "vue-property-decorator": "^7.0.0", 16 | "vue-router": "^3.0.1", 17 | "vuex": "^3.0.1" 18 | }, 19 | "devDependencies": { 20 | "@vue/cli-plugin-babel": "^3.3.0", 21 | "@vue/cli-plugin-pwa": "^3.3.0", 22 | "@vue/cli-plugin-typescript": "^3.3.0", 23 | "@vue/cli-service": "^3.3.0", 24 | "typescript": "^3.0.0", 25 | "vue-template-compiler": "^2.5.21" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | autoprefixer: {} 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n11sh1/vue-pwa-tutorial/8aa438386d6923cf70534adc1cf22bd971165507/public/favicon.ico -------------------------------------------------------------------------------- /public/firebase-messaging-sw.js: -------------------------------------------------------------------------------- 1 | // [START initialize_firebase_in_sw] 2 | // Give the service worker access to Firebase Messaging. 3 | // Note that you can only use Firebase Messaging here, other Firebase libraries 4 | // are not available in the service worker. 5 | importScripts('https://www.gstatic.com/firebasejs/5.5.6/firebase-app.js'); 6 | importScripts('https://www.gstatic.com/firebasejs/5.5.6/firebase-messaging.js'); 7 | // Initialize the Firebase app in the service worker by passing in the messagingSenderId. 8 | firebase.initializeApp({ 9 | 'messagingSenderId': '630674987445' 10 | }); 11 | 12 | // Retrieve an instance of Firebase Messaging so that it can handle background messages. 13 | const messaging = firebase.messaging(); 14 | // [END initialize_firebase_in_sw] -------------------------------------------------------------------------------- /public/img/icons/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n11sh1/vue-pwa-tutorial/8aa438386d6923cf70534adc1cf22bd971165507/public/img/icons/android-chrome-192x192.png -------------------------------------------------------------------------------- /public/img/icons/android-chrome-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n11sh1/vue-pwa-tutorial/8aa438386d6923cf70534adc1cf22bd971165507/public/img/icons/android-chrome-512x512.png -------------------------------------------------------------------------------- /public/img/icons/apple-touch-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n11sh1/vue-pwa-tutorial/8aa438386d6923cf70534adc1cf22bd971165507/public/img/icons/apple-touch-icon-120x120.png -------------------------------------------------------------------------------- /public/img/icons/apple-touch-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n11sh1/vue-pwa-tutorial/8aa438386d6923cf70534adc1cf22bd971165507/public/img/icons/apple-touch-icon-152x152.png -------------------------------------------------------------------------------- /public/img/icons/apple-touch-icon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n11sh1/vue-pwa-tutorial/8aa438386d6923cf70534adc1cf22bd971165507/public/img/icons/apple-touch-icon-180x180.png -------------------------------------------------------------------------------- /public/img/icons/apple-touch-icon-60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n11sh1/vue-pwa-tutorial/8aa438386d6923cf70534adc1cf22bd971165507/public/img/icons/apple-touch-icon-60x60.png -------------------------------------------------------------------------------- /public/img/icons/apple-touch-icon-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n11sh1/vue-pwa-tutorial/8aa438386d6923cf70534adc1cf22bd971165507/public/img/icons/apple-touch-icon-76x76.png -------------------------------------------------------------------------------- /public/img/icons/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n11sh1/vue-pwa-tutorial/8aa438386d6923cf70534adc1cf22bd971165507/public/img/icons/apple-touch-icon.png -------------------------------------------------------------------------------- /public/img/icons/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n11sh1/vue-pwa-tutorial/8aa438386d6923cf70534adc1cf22bd971165507/public/img/icons/favicon-16x16.png -------------------------------------------------------------------------------- /public/img/icons/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n11sh1/vue-pwa-tutorial/8aa438386d6923cf70534adc1cf22bd971165507/public/img/icons/favicon-32x32.png -------------------------------------------------------------------------------- /public/img/icons/msapplication-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n11sh1/vue-pwa-tutorial/8aa438386d6923cf70534adc1cf22bd971165507/public/img/icons/msapplication-icon-144x144.png -------------------------------------------------------------------------------- /public/img/icons/mstile-150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n11sh1/vue-pwa-tutorial/8aa438386d6923cf70534adc1cf22bd971165507/public/img/icons/mstile-150x150.png -------------------------------------------------------------------------------- /public/img/icons/safari-pinned-tab.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 150 | -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 |
5 | For a guide and recipes on how to configure / customize this project,
6 | check out the
7 | vue-cli documentation.
8 |