├── .firebaserc.sample ├── .gitattributes ├── .gitignore ├── README.md ├── firebase.json ├── package.json ├── prod ├── client │ ├── assets │ │ ├── index.spa.html │ │ ├── index.ssr.html │ │ ├── server-bundle.json │ │ └── vue-ssr-client-manifest.json │ ├── favicon.ico │ ├── icon.png │ └── site.jpg └── server │ ├── index.js │ ├── package.json │ └── yarn.lock ├── src ├── .editorconfig ├── .eslintrc.js ├── .nuxt │ ├── App.js │ ├── client.js │ ├── components │ │ ├── no-ssr.js │ │ ├── nuxt-child.js │ │ ├── nuxt-error.vue │ │ ├── nuxt-link.js │ │ ├── nuxt-loading.vue │ │ └── nuxt.js │ ├── dist │ │ ├── 2aa56ac0bcbbc141d9ca.js │ │ ├── 6f77ffcd15ddb20c4434.js │ │ ├── LICENSES │ │ ├── a95365ffe4047e6094dd.js │ │ ├── c79fef71b97fb2a1e26e.js │ │ ├── d97ee76b6641d6111716.js │ │ ├── icons │ │ │ ├── icon_120.9qid3ZBUcQn.png │ │ │ ├── icon_144.9qid3ZBUcQn.png │ │ │ ├── icon_152.9qid3ZBUcQn.png │ │ │ ├── icon_192.9qid3ZBUcQn.png │ │ │ ├── icon_384.9qid3ZBUcQn.png │ │ │ ├── icon_512.9qid3ZBUcQn.png │ │ │ └── icon_64.9qid3ZBUcQn.png │ │ ├── index.spa.html │ │ ├── index.ssr.html │ │ ├── manifest.18c4f7f1.json │ │ ├── server-bundle.json │ │ ├── vue-ssr-client-manifest.json │ │ └── workbox.3de3418b.js │ ├── empty.js │ ├── index.js │ ├── loading.html │ ├── middleware.js │ ├── router.js │ ├── server.js │ ├── store.js │ ├── utils.js │ └── views │ │ ├── app.template.html │ │ └── error.html ├── README.md ├── assets │ ├── README.md │ └── styles │ │ └── main.css ├── components │ ├── AppFooter.vue │ ├── AppHeader.vue │ └── Logo.vue ├── layouts │ └── default.vue ├── middleware │ └── .gitkeep ├── nuxt.config.js ├── package.json ├── pages │ ├── index.vue │ ├── page2.vue │ └── page3.vue ├── plugins │ └── .gitkeep ├── static │ ├── favicon.ico │ ├── icon.png │ └── site.jpg ├── store │ └── index.js └── yarn.lock └── yarn.lock /.firebaserc.sample: -------------------------------------------------------------------------------- 1 | { 2 | "projects": { 3 | "default": "your-project-id" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # These settings are for any web project 2 | 3 | # Handle line endings automatically for files detected as text 4 | # and leave all files detected as binary untouched. 5 | * text=auto 6 | 7 | # 8 | # The above will handle all files NOT found below 9 | # 10 | 11 | # 12 | ## These files are text and should be normalized (Convert crlf => lf) 13 | # 14 | 15 | # source code 16 | *.php text 17 | *.css text 18 | *.sass text 19 | *.scss text 20 | *.less text 21 | *.styl text 22 | *.js text 23 | *.coffee text 24 | *.json text 25 | *.htm text 26 | *.html text 27 | *.xml text 28 | *.svg text 29 | *.txt text 30 | *.ini text 31 | *.inc text 32 | *.pl text 33 | *.rb text 34 | *.py text 35 | *.scm text 36 | *.sql text 37 | *.sh text 38 | *.bat text 39 | 40 | # templates 41 | *.ejs text 42 | *.hbt text 43 | *.jade text 44 | *.haml text 45 | *.hbs text 46 | *.dot text 47 | *.tmpl text 48 | *.phtml text 49 | 50 | # server config 51 | .htaccess text 52 | 53 | # git config 54 | .gitattributes text 55 | .gitignore text 56 | 57 | # code analysis config 58 | .jshintrc text 59 | .jscsrc text 60 | .jshintignore text 61 | .csslintrc text 62 | 63 | # misc config 64 | *.yaml text 65 | *.yml text 66 | .editorconfig text 67 | 68 | # build config 69 | *.npmignore text 70 | *.bowerrc text 71 | 72 | # Heroku 73 | Procfile text 74 | .slugignore text 75 | 76 | # Documentation 77 | *.md text 78 | LICENSE text 79 | AUTHORS text 80 | 81 | 82 | # 83 | ## These files are binary and should be left untouched 84 | # 85 | 86 | # (binary is a macro for -text -diff) 87 | *.png binary 88 | *.jpg binary 89 | *.jpeg binary 90 | *.gif binary 91 | *.ico binary 92 | *.mov binary 93 | *.mp4 binary 94 | *.mp3 binary 95 | *.flv binary 96 | *.fla binary 97 | *.swf binary 98 | *.gz binary 99 | *.zip binary 100 | *.7z binary 101 | *.ttf binary 102 | *.eot binary 103 | *.woff binary 104 | *.pyc binary 105 | *.pdf binary 106 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ### https://raw.github.com/github/gitignore/8edb8a95c4c4b3dce71a378aaaf89275510b9cef/Node.gitignore 2 | **/*/sw.* 3 | sw.* 4 | 5 | backups 6 | prod/client/assets/ 7 | prod/server/nuxt/ 8 | .firebaserc 9 | 10 | .DS_Store 11 | **/**/.DS_Store 12 | **/**/node_modules 13 | ProjectNotes.md 14 | # Logs 15 | logs 16 | *.log 17 | npm-debug.log* 18 | yarn-debug.log* 19 | yarn-error.log* 20 | 21 | # Runtime data 22 | pids 23 | *.pid 24 | *.seed 25 | *.pid.lock 26 | 27 | # Directory for instrumented libs generated by jscoverage/JSCover 28 | lib-cov 29 | 30 | # Coverage directory used by tools like istanbul 31 | coverage 32 | 33 | # nyc test coverage 34 | .nyc_output 35 | 36 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 37 | .grunt 38 | 39 | # Bower dependency directory (https://bower.io/) 40 | bower_components 41 | 42 | # node-waf configuration 43 | .lock-wscript 44 | 45 | # Compiled binary addons (http://nodejs.org/api/addons.html) 46 | build/Release 47 | 48 | # Dependency directories 49 | node_modules/ 50 | jspm_packages/ 51 | 52 | # Typescript v1 declaration files 53 | typings/ 54 | 55 | # Optional npm cache directory 56 | .npm 57 | 58 | # Optional eslint cache 59 | .eslintcache 60 | 61 | # Optional REPL history 62 | .node_repl_history 63 | 64 | # Output of 'npm pack' 65 | *.tgz 66 | 67 | # Yarn Integrity file 68 | .yarn-integrity 69 | 70 | # dotenv environment variables file 71 | .env 72 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Nuxt.js Universal App with SSR via Firebase Functions and Firebase Hosting - **_Nuxt 2 Version_** 2 | 3 | Host a Nuxt Universal app or site by combining Nuxt.js with Firebase Cloud Functions and Hosting. 4 | 5 | [Live Preview](https://nuxt2ssrfire.firebaseapp.com) 6 | 7 | --- 8 | 9 | ## Pre-Setup: Before Installing Any Dependencies 10 | 11 | 1. Obtain a Firebase Project ID to use for this project. [See Overiew Here](#firebase-project-setup) 12 | 13 | 2. Inside this directory, locate the file `.firebaserc.sample`, and do the following: 14 | 15 | - Rename this file to `.firebaserc` 16 | - Inside this file, replace `your-project-id` with your Firebase Project ID. 17 | 18 | --- 19 | 20 | ## Setup 21 | 22 | We will now get everything setup and deployed in 3 commands: 23 | 24 | **Note:** _All of these commands are ran from the root directory_ 25 | 26 | 1. Install Dependencies in all necessary directories in 1 command 27 | 28 | ```bash 29 | yarn setup 30 | # OR 31 | npm run setup 32 | ``` 33 | 34 | 2. Build The Project 35 | 36 | ```bash 37 | yarn build 38 | # OR 39 | npm run build 40 | ``` 41 | 42 | 3. Deploy To Firebase 43 | 44 | ```bash 45 | yarn deploy 46 | # OR 47 | npm run deploy 48 | ``` 49 | 50 | **_Your site should now be live!_** 51 | 52 | --- 53 | 54 | ## Development 55 | 56 | There are 2 development options. 57 | 58 | ### 1. _Without_ Firebase Functions 59 | 60 | This will be like a normal Nuxt development experienced. 61 | 62 | ```bash 63 | yarn dev 64 | ``` 65 | 66 | ### 2. _With_ Firebase Functions 67 | 68 | This uses Firebase's local development tools to test our project 69 | 70 | ```bash 71 | yarn serve 72 | ``` 73 | 74 | --- 75 | 76 | ### Firebase Project Setup 77 | 78 | 1. Create a Firebase Project using the [Firebase Console](https://console.firebase.google.com). 79 | 80 | 2. Obtain the Firebase Project ID 81 | 82 | ### Features 83 | 84 | - Server-side rendering with Firebase Hosting combined with Firebase Functions 85 | - Firebase Hosting as our CDN for our publicPath (See nuxt.config.js) 86 | 87 | ### Things to know... 88 | 89 | - You must have the Firebase CLI installed. If you don't have it install it with `npm install -g firebase-tools` and then configure it with `firebase login`. 90 | 91 | - If you have errors, make sure `firebase-tools` is up to date. I've experienced many problems that were resolved once I updated. 92 | 93 | * The root directory has a package.json file with several scripts that will be used to optimize and ease getting started and the workflow 94 | 95 | * ALL commands are ran from the root directory 96 | -------------------------------------------------------------------------------- /firebase.json: -------------------------------------------------------------------------------- 1 | { 2 | "hosting": { 3 | "public": "prod/client", 4 | "ignore": [ 5 | "firebase.json", 6 | "**/.*", 7 | "**/node_modules/**" 8 | ], 9 | "rewrites": [ 10 | { 11 | "source": "**", 12 | "function": "nuxtssr" 13 | } 14 | ] 15 | }, 16 | "functions": { 17 | "source": "prod/server" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Nuxt-SSR-Firebase", 3 | "version": "0.2.0", 4 | "description": "Nuxt.js 2 app with SSR using Firebase Cloud Functions and Firebase Hosting.", 5 | "license": "MIT", 6 | "author": "David Royer", 7 | "repository": "https://github.com/davidroyer/nuxt-ssr-firebase", 8 | "scripts": { 9 | "dev": "cd \"src\" && yarn dev", 10 | "build": "yarn build:nuxt && yarn clean && yarn copyassets", 11 | "serve": "NODE_ENV=development firebase serve", 12 | "deploy": "firebase deploy", 13 | "predeploy": "yarn build", 14 | "setup": "yarn install && yarn setup:client && yarn setup:server", 15 | "setup:client": "cd \"src\" && yarn install", 16 | "setup:server": "cd \"prod/server\" && yarn install", 17 | "copyassets": "yarn copydist && yarn copystatic", 18 | "copydist": "cp -R prod/server/nuxt/dist/ prod/client/assets", 19 | "copystatic": "cp -R src/static/ prod/client", 20 | "clean": "rimraf prod/client/assets/* && rimraf prod/client/*.*", 21 | "build:nuxt": "cd \"src\" && yarn build" 22 | }, 23 | "devDependencies": { 24 | "cross-env": "^5.0.5", 25 | "rimraf": "^2.6.2" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /prod/client/assets/index.spa.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{ HEAD }} 5 | 6 | 7 | {{ APP }} 8 | 9 | 10 | -------------------------------------------------------------------------------- /prod/client/assets/index.ssr.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{ HEAD }} 5 | 6 | 7 | {{ APP }} 8 | 9 | 10 | -------------------------------------------------------------------------------- /prod/client/assets/vue-ssr-client-manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "publicPath": "/assets/", 3 | "all": [ 4 | "icons/icon_144.9qid3ZBUcQn.png", 5 | "2aa56ac0bcbbc141d9ca.js", 6 | "a95365ffe4047e6094dd.js", 7 | "f4ea9fa3a65fe239f29e.js", 8 | "9e5e48e3aa724b419f04.js", 9 | "LICENSES", 10 | "icons/icon_64.9qid3ZBUcQn.png", 11 | "icons/icon_120.9qid3ZBUcQn.png", 12 | "6f77ffcd15ddb20c4434.js", 13 | "icons/icon_152.9qid3ZBUcQn.png", 14 | "icons/icon_192.9qid3ZBUcQn.png", 15 | "icons/icon_384.9qid3ZBUcQn.png", 16 | "icons/icon_512.9qid3ZBUcQn.png", 17 | "manifest.18c4f7f1.json", 18 | "index.ssr.html", 19 | "index.spa.html" 20 | ], 21 | "initial": [ 22 | "f4ea9fa3a65fe239f29e.js", 23 | "9e5e48e3aa724b419f04.js" 24 | ], 25 | "async": [ 26 | "2aa56ac0bcbbc141d9ca.js", 27 | "a95365ffe4047e6094dd.js", 28 | "6f77ffcd15ddb20c4434.js" 29 | ], 30 | "modules": { 31 | "14502198": [ 32 | 3 33 | ], 34 | "54501242": [ 35 | 3 36 | ], 37 | "7e4ce0de": [ 38 | 3 39 | ], 40 | "5001d4bc": [ 41 | 3 42 | ], 43 | "06501d7c": [ 44 | 3 45 | ], 46 | "155f3b8a": [ 47 | 3 48 | ], 49 | "5b2c5af7": [ 50 | 3 51 | ], 52 | "63a080d5": [ 53 | 3 54 | ], 55 | "3642b0c9": [ 56 | 3 57 | ], 58 | "2eea921d": [ 59 | 3 60 | ], 61 | "5b351356": [ 62 | 3 63 | ], 64 | "51865a20": [ 65 | 3 66 | ], 67 | "70d7c10c": [ 68 | 3 69 | ], 70 | "5d3a0546": [ 71 | 3 72 | ], 73 | "2aaa1a58": [ 74 | 3 75 | ], 76 | "497ae47a": [ 77 | 3 78 | ], 79 | "0f2bc1dc": [ 80 | 3 81 | ], 82 | "1a65a490": [ 83 | 3 84 | ], 85 | "2bea819a": [ 86 | 3 87 | ], 88 | "29040fda": [ 89 | 3 90 | ], 91 | "05090404": [ 92 | 4 93 | ], 94 | "53aff1e4": [ 95 | 4 96 | ], 97 | "60f776b8": [ 98 | 3 99 | ], 100 | "0e249e42": [ 101 | 3 102 | ], 103 | "eef0f7a0": [ 104 | 3 105 | ], 106 | "55b953d8": [ 107 | 3 108 | ], 109 | "41b2099a": [ 110 | 3 111 | ], 112 | "d297055c": [ 113 | 3 114 | ], 115 | "752d63af": [ 116 | 3 117 | ], 118 | "1b6b1c39": [ 119 | 3 120 | ], 121 | "3f1f713c": [ 122 | 3 123 | ], 124 | "439147a2": [ 125 | 3 126 | ], 127 | "6013cf04": [ 128 | 3 129 | ], 130 | "fd81a62a": [ 131 | 3 132 | ], 133 | "b31fdc94": [ 134 | 3 135 | ], 136 | "4200adcd": [ 137 | 3 138 | ], 139 | "6da85d62": [ 140 | 4 141 | ], 142 | "6d7cd40e": [ 143 | 4 144 | ], 145 | "7279b843": [ 146 | 4 147 | ], 148 | "6d78a4c2": [ 149 | 4 150 | ], 151 | "669b2596": [ 152 | 4 153 | ], 154 | "e1f4c75c": [ 155 | 3 156 | ], 157 | "c0fe4470": [ 158 | 3 159 | ], 160 | "ec7efc7a": [ 161 | 3 162 | ], 163 | "58a59a0a": [ 164 | 3 165 | ], 166 | "03caef9e": [ 167 | 3 168 | ], 169 | "6e278281": [ 170 | 3 171 | ], 172 | "22bbc43d": [ 173 | 3 174 | ], 175 | "0d0d21ba": [ 176 | 3 177 | ], 178 | "359f450a": [ 179 | 3 180 | ], 181 | "34703a16": [ 182 | 3 183 | ], 184 | "167720ba": [ 185 | 3 186 | ], 187 | "72db6305": [ 188 | 3 189 | ], 190 | "5bbdd6b3": [ 191 | 3 192 | ], 193 | "00e8b82b": [ 194 | 3 195 | ], 196 | "f7ca66e4": [ 197 | 3 198 | ], 199 | "17ae2e58": [ 200 | 3 201 | ], 202 | "0be49c28": [ 203 | 4 204 | ], 205 | "3adfbcba": [ 206 | 3 207 | ], 208 | "a31de1b2": [ 209 | 3 210 | ], 211 | "49583c5a": [ 212 | 3 213 | ], 214 | "92b4e05a": [ 215 | 3 216 | ], 217 | "60c74a95": [ 218 | 3 219 | ], 220 | "cfbdd46a": [ 221 | 3 222 | ], 223 | "0703591b": [ 224 | 3 225 | ], 226 | "2d2ccf25": [ 227 | 3 228 | ], 229 | "2b986b4a": [ 230 | 3 231 | ], 232 | "58aa25c0": [ 233 | 3 234 | ], 235 | "06147eaf": [ 236 | 3 237 | ], 238 | "4c3c621c": [ 239 | 3 240 | ], 241 | "16f544ec": [ 242 | 3 243 | ], 244 | "2fb3fa5c": [ 245 | 3 246 | ], 247 | "22f9958a": [ 248 | 3 249 | ], 250 | "4e2dd768": [ 251 | 3 252 | ], 253 | "5be0fea3": [ 254 | 3 255 | ], 256 | "650cf044": [ 257 | 3 258 | ], 259 | "84031bfa": [ 260 | 3 261 | ], 262 | "7958b580": [ 263 | 3 264 | ], 265 | "2461170c": [ 266 | 4 267 | ], 268 | "2a1a843a": [ 269 | 4 270 | ], 271 | "ebbf3db4": [ 272 | 4 273 | ], 274 | "43b0463a": [ 275 | 4 276 | ], 277 | "5ec83b28": [ 278 | 3 279 | ], 280 | "6a73df2a": [ 281 | 3 282 | ], 283 | "5baec0b5": [ 284 | 4 285 | ], 286 | "5b976c21": [ 287 | 4 288 | ], 289 | "4885e307": [ 290 | 4 291 | ], 292 | "7e9b7b1b": [ 293 | 4 294 | ], 295 | "0121c386": [ 296 | 4 297 | ], 298 | "ec9540cc": [ 299 | 4 300 | ], 301 | "c29616c6": [ 302 | 4 303 | ], 304 | "6139684e": [ 305 | 4 306 | ], 307 | "4521485a": [ 308 | 4 309 | ], 310 | "4b678f24": [ 311 | 4 312 | ], 313 | "63e0c584": [ 314 | 4 315 | ], 316 | "3327ba76": [ 317 | 4 318 | ], 319 | "4741edf6": [ 320 | 3 321 | ], 322 | "06d92d05": [ 323 | 3 324 | ], 325 | "645a1497": [ 326 | 3 327 | ], 328 | "e0479b9a": [ 329 | 3 330 | ], 331 | "4d3cf23d": [ 332 | 3 333 | ], 334 | "c6091e14": [ 335 | 3 336 | ], 337 | "53dcccb7": [ 338 | 3 339 | ], 340 | "6503bd21": [ 341 | 3 342 | ], 343 | "a56ebff6": [ 344 | 3 345 | ], 346 | "43d23f26": [ 347 | 3 348 | ], 349 | "3ed0803c": [ 350 | 3 351 | ], 352 | "2ff8cc20": [ 353 | 3 354 | ], 355 | "869faff4": [ 356 | 3 357 | ], 358 | "66137f40": [ 359 | 3 360 | ], 361 | "9aaf2016": [ 362 | 3 363 | ], 364 | "a5803654": [ 365 | 3 366 | ], 367 | "12791b0e": [ 368 | 3 369 | ], 370 | "423c9a5c": [ 371 | 3 372 | ], 373 | "a026283a": [ 374 | 3 375 | ], 376 | "15fb62f8": [ 377 | 3 378 | ], 379 | "74670ad2": [ 380 | 3 381 | ], 382 | "47f70eaa": [ 383 | 3 384 | ], 385 | "470823fc": [ 386 | 3 387 | ], 388 | "41a4e7b6": [ 389 | 3 390 | ], 391 | "802a7a7e": [ 392 | 3 393 | ], 394 | "438fda3f": [ 395 | 3 396 | ], 397 | "bf241c02": [ 398 | 3 399 | ], 400 | "622a3f64": [ 401 | 3 402 | ], 403 | "2608ae2e": [ 404 | 3 405 | ], 406 | "24f31105": [ 407 | 3 408 | ], 409 | "7d13e3a9": [ 410 | 3 411 | ], 412 | "58b33d2c": [ 413 | 3 414 | ], 415 | "81865d68": [ 416 | 3 417 | ], 418 | "0822b904": [ 419 | 3 420 | ], 421 | "31c88054": [ 422 | 3 423 | ], 424 | "154ecbd6": [ 425 | 3 426 | ], 427 | "d2841012": [ 428 | 3 429 | ], 430 | "7637e8af": [ 431 | 3 432 | ], 433 | "2e59b793": [ 434 | 3 435 | ], 436 | "cca0889e": [ 437 | 3 438 | ], 439 | "15e47d68": [ 440 | 3 441 | ], 442 | "302b03e2": [ 443 | 3 444 | ], 445 | "691f6574": [ 446 | 3 447 | ], 448 | "2323c05b": [ 449 | 3 450 | ], 451 | "2b0e4b81": [ 452 | 3 453 | ], 454 | "5601553a": [ 455 | 3 456 | ], 457 | "18a001c5": [ 458 | 3 459 | ], 460 | "7fa5a5bf": [ 461 | 3 462 | ], 463 | "2a91d752": [ 464 | 3 465 | ], 466 | "aae6143c": [ 467 | 1 468 | ], 469 | "3cfa209e": [ 470 | 1 471 | ], 472 | "3ce2cc0a": [ 473 | 1 474 | ], 475 | "10a2f4fa": [ 476 | 8 477 | ], 478 | "1086c5f8": [ 479 | 2 480 | ], 481 | "d533015c": [ 482 | 1 483 | ] 484 | } 485 | } -------------------------------------------------------------------------------- /prod/client/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidroyer/nuxt2-ssr-firebase/c7fce7b4b83d5b05671beab59cd943539c378b46/prod/client/favicon.ico -------------------------------------------------------------------------------- /prod/client/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidroyer/nuxt2-ssr-firebase/c7fce7b4b83d5b05671beab59cd943539c378b46/prod/client/icon.png -------------------------------------------------------------------------------- /prod/client/site.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidroyer/nuxt2-ssr-firebase/c7fce7b4b83d5b05671beab59cd943539c378b46/prod/client/site.jpg -------------------------------------------------------------------------------- /prod/server/index.js: -------------------------------------------------------------------------------- 1 | const functions = require("firebase-functions"); 2 | const { Nuxt, Builder } = require("nuxt-edge"); 3 | const express = require("express"); 4 | const app = express(); 5 | const config = { 6 | dev: false, 7 | buildDir: "nuxt", 8 | build: { 9 | publicPath: "/assets/" 10 | } 11 | }; 12 | const nuxt = new Nuxt(config); 13 | 14 | function handleRequest(req, res) { 15 | console.log("IN New Nuxt Trial: "); 16 | const isProduction = process.env.NODE_ENV === "development" ? false : true; 17 | if (isProduction) 18 | res.set("Cache-Control", "public, max-age=150, s-maxage=150"); 19 | 20 | try { 21 | nuxt.render(req, res); 22 | } catch (err) { 23 | console.error(err); 24 | } 25 | } 26 | 27 | app.use(handleRequest); 28 | exports.nuxtssr = functions.https.onRequest(app); 29 | -------------------------------------------------------------------------------- /prod/server/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "functions", 3 | "description": "Nuxt-SSR-Firebase: Nuxt.js with Firebase Functions Production Setup", 4 | "dependencies": { 5 | "express": "^4.15.3", 6 | "firebase-admin": "~5.13.1", 7 | "firebase-functions": "^2.0.0", 8 | "lodash": "^4.17.10", 9 | "nuxt-edge": "^2.0.0-25471736.3b2ed03" 10 | }, 11 | "engines": { 12 | "node": "8" 13 | }, 14 | "private": true 15 | } 16 | -------------------------------------------------------------------------------- /src/.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_size = 2 6 | indent_style = space 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.md] 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /src/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | parser: 'babel-eslint', 4 | env: { 5 | browser: true, 6 | node: true 7 | }, 8 | // required to lint *.vue files 9 | plugins: [ 10 | 'html' 11 | ], 12 | // add your custom rules here 13 | rules: {}, 14 | globals: {} 15 | } 16 | -------------------------------------------------------------------------------- /src/.nuxt/App.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import NuxtLoading from './components/nuxt-loading.vue' 3 | 4 | import '../assets/styles/main.css' 5 | 6 | 7 | import _6f6c098b from '../layouts/default.vue' 8 | 9 | const layouts = { "_default": _6f6c098b } 10 | 11 | 12 | 13 | export default { 14 | head: {"title":"Nuxtjs SSR on Firebase Functions","meta":[{"charset":"utf-8"},{"name":"viewport","content":"width=device-width, initial-scale=1"},{"hid":"description","name":"description","content":"Nuxt.js project"},{"hid":"mobile-web-app-capable","name":"mobile-web-app-capable","content":"yes"},{"hid":"apple-mobile-web-app-title","name":"apple-mobile-web-app-title","content":"nuxt-ssr-firebase-source"},{"hid":"theme-color","name":"theme-color","content":"#3B8070"},{"hid":"og:type","name":"og:type","property":"og:type","content":"website"},{"hid":"og:title","name":"og:title","property":"og:title","content":"nuxt-ssr-firebase-source"},{"hid":"og:description","name":"og:description","property":"og:description","content":"\u003E Nuxt.js project"}],"link":[{"rel":"icon","type":"image\u002Fx-icon","href":"\u002Ffavicon.ico"},{"rel":"stylesheet","href":"https:\u002F\u002Ffonts.googleapis.com\u002Fcss?family=Roboto"},{"rel":"stylesheet","href":"https:\u002F\u002Fcdn.muicss.com\u002Fmui-0.9.35\u002Fcss\u002Fmui.min.css"},{"rel":"manifest","href":"\u002Fassets\u002Fmanifest.18c4f7f1.json"},{"rel":"shortcut icon","href":"\u002Fassets\u002Ficons\u002Ficon_64.9qid3ZBUcQn.png"},{"rel":"apple-touch-icon","href":"\u002Fassets\u002Ficons\u002Ficon_512.9qid3ZBUcQn.png","sizes":"512x512"}],"style":[],"script":[],"htmlAttrs":{"lang":"en"}}, 15 | render(h, props) { 16 | const loadingEl = h('nuxt-loading', { ref: 'loading' }) 17 | const layoutEl = h(this.layout || 'nuxt') 18 | const templateEl = h('div', { 19 | domProps: { 20 | id: '__layout' 21 | }, 22 | key: this.layoutName 23 | }, [ layoutEl ]) 24 | 25 | const transitionEl = h('transition', { 26 | props: { 27 | name: 'layout', 28 | mode: 'out-in' 29 | } 30 | }, [ templateEl ]) 31 | 32 | return h('div',{ 33 | domProps: { 34 | id: '__nuxt' 35 | } 36 | }, [ 37 | loadingEl, 38 | transitionEl 39 | ]) 40 | }, 41 | data: () => ({ 42 | layout: null, 43 | layoutName: '' 44 | }), 45 | beforeCreate () { 46 | Vue.util.defineReactive(this, 'nuxt', this.$options.nuxt) 47 | }, 48 | created () { 49 | // Add this.$nuxt in child instances 50 | Vue.prototype.$nuxt = this 51 | // add to window so we can listen when ready 52 | if (typeof window !== 'undefined') { 53 | window.$nuxt = this 54 | } 55 | // Add $nuxt.error() 56 | this.error = this.nuxt.error 57 | }, 58 | 59 | mounted () { 60 | this.$loading = this.$refs.loading 61 | }, 62 | watch: { 63 | 'nuxt.err': 'errorChanged' 64 | }, 65 | 66 | methods: { 67 | 68 | errorChanged () { 69 | if (this.nuxt.err && this.$loading) { 70 | if (this.$loading.fail) this.$loading.fail() 71 | if (this.$loading.finish) this.$loading.finish() 72 | } 73 | }, 74 | 75 | 76 | setLayout(layout) { 77 | if (!layout || !layouts['_' + layout]) layout = 'default' 78 | this.layoutName = layout 79 | this.layout = layouts['_' + layout] 80 | return this.layout 81 | }, 82 | loadLayout(layout) { 83 | if (!layout || !layouts['_' + layout]) layout = 'default' 84 | return Promise.resolve(layouts['_' + layout]) 85 | } 86 | 87 | }, 88 | components: { 89 | NuxtLoading 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /src/.nuxt/client.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import middleware from './middleware' 3 | import { createApp, NuxtError } from './index' 4 | import { 5 | applyAsyncData, 6 | sanitizeComponent, 7 | resolveRouteComponents, 8 | getMatchedComponents, 9 | getMatchedComponentsInstances, 10 | flatMapComponents, 11 | setContext, 12 | middlewareSeries, 13 | promisify, 14 | getLocation, 15 | compile, 16 | getQueryDiff 17 | } from './utils' 18 | 19 | const noopData = () => { return {} } 20 | const noopFetch = () => {} 21 | 22 | // Global shared references 23 | let _lastPaths = [] 24 | let app 25 | let router 26 | let store 27 | 28 | // Try to rehydrate SSR data from window 29 | const NUXT = window.__NUXT__ || {} 30 | 31 | 32 | // Setup global Vue error handler 33 | const defaultErrorHandler = Vue.config.errorHandler 34 | Vue.config.errorHandler = function (err, vm, info) { 35 | const nuxtError = { 36 | statusCode: err.statusCode || err.name || 'Whoops!', 37 | message: err.message || err.toString() 38 | } 39 | 40 | // Call other handler if exist 41 | let handled = null 42 | if (typeof defaultErrorHandler === 'function') { 43 | handled = defaultErrorHandler(...arguments) 44 | } 45 | if(handled === true){ 46 | return handled 47 | } 48 | 49 | // Show Nuxt Error Page 50 | if(vm && vm.$root && vm.$root.$nuxt && vm.$root.$nuxt.error && info !== 'render function') { 51 | vm.$root.$nuxt.error(nuxtError) 52 | } 53 | if (typeof defaultErrorHandler === 'function') { 54 | return handled 55 | } 56 | 57 | // Log to console 58 | if (process.env.NODE_ENV !== 'production') { 59 | console.error(err) 60 | } else { 61 | console.error(err.message || nuxtError.message) 62 | } 63 | } 64 | 65 | 66 | // Create and mount App 67 | createApp() 68 | .then(mountApp) 69 | .catch(err => { 70 | if (err.message === 'ERR_REDIRECT') { 71 | return // Wait for browser to redirect... 72 | } 73 | console.error('[nuxt] Error while initializing app', err) 74 | }) 75 | 76 | function componentOption(component, key, ...args) { 77 | if (!component || !component.options || !component.options[key]) { 78 | return {} 79 | } 80 | const option = component.options[key] 81 | if (typeof option === 'function') { 82 | return option(...args) 83 | } 84 | return option 85 | } 86 | 87 | function mapTransitions(Components, to, from) { 88 | const componentTransitions = component => { 89 | const transition = componentOption(component, 'transition', to, from) || {} 90 | return (typeof transition === 'string' ? { name: transition } : transition) 91 | } 92 | 93 | return Components.map(Component => { 94 | // Clone original object to prevent overrides 95 | const transitions = Object.assign({}, componentTransitions(Component)) 96 | 97 | // Combine transitions & prefer `leave` transitions of 'from' route 98 | if (from && from.matched.length && from.matched[0].components.default) { 99 | const from_transitions = componentTransitions(from.matched[0].components.default) 100 | Object.keys(from_transitions) 101 | .filter(key => from_transitions[key] && key.toLowerCase().indexOf('leave') !== -1) 102 | .forEach(key => { transitions[key] = from_transitions[key] }) 103 | } 104 | 105 | return transitions 106 | }) 107 | } 108 | 109 | async function loadAsyncComponents (to, from, next) { 110 | // Check if route path changed (this._pathChanged), only if the page is not an error (for validate()) 111 | this._pathChanged = !!app.nuxt.err || from.path !== to.path 112 | this._queryChanged = JSON.stringify(to.query) !== JSON.stringify(from.query) 113 | this._diffQuery = (this._queryChanged ? getQueryDiff(to.query, from.query) : []) 114 | 115 | 116 | if (this._pathChanged && this.$loading.start) { 117 | this.$loading.start() 118 | } 119 | 120 | 121 | try { 122 | const Components = await resolveRouteComponents(to) 123 | 124 | if (!this._pathChanged && this._queryChanged) { 125 | // Add a marker on each component that it needs to refresh or not 126 | const startLoader = Components.some((Component) => { 127 | const watchQuery = Component.options.watchQuery 128 | if (watchQuery === true) return true 129 | if (Array.isArray(watchQuery)) { 130 | return watchQuery.some((key) => this._diffQuery[key]) 131 | } 132 | return false 133 | }) 134 | if (startLoader && this.$loading.start) { 135 | this.$loading.start() 136 | } 137 | } 138 | 139 | // Call next() 140 | next() 141 | } catch (err) { 142 | err = err || {} 143 | const statusCode = err.statusCode || err.status || (err.response && err.response.status) || 500 144 | this.error({ statusCode, message: err.message }) 145 | this.$nuxt.$emit('routeChanged', to, from, err) 146 | next(false) 147 | } 148 | } 149 | 150 | function applySSRData(Component, ssrData) { 151 | if (NUXT.serverRendered && ssrData) { 152 | applyAsyncData(Component, ssrData) 153 | } 154 | Component._Ctor = Component 155 | return Component 156 | } 157 | 158 | // Get matched components 159 | function resolveComponents(router) { 160 | const path = getLocation(router.options.base, router.options.mode) 161 | 162 | return flatMapComponents(router.match(path), async (Component, _, match, key, index) => { 163 | // If component is not resolved yet, resolve it 164 | if (typeof Component === 'function' && !Component.options) { 165 | Component = await Component() 166 | } 167 | // Sanitize it and save it 168 | const _Component = applySSRData(sanitizeComponent(Component), NUXT.data ? NUXT.data[index] : null) 169 | match.components[key] = _Component 170 | return _Component 171 | }) 172 | } 173 | 174 | function callMiddleware (Components, context, layout) { 175 | let midd = [] 176 | let unknownMiddleware = false 177 | 178 | // If layout is undefined, only call global middleware 179 | if (typeof layout !== 'undefined') { 180 | midd = [] // Exclude global middleware if layout defined (already called before) 181 | if (layout.middleware) { 182 | midd = midd.concat(layout.middleware) 183 | } 184 | Components.forEach(Component => { 185 | if (Component.options.middleware) { 186 | midd = midd.concat(Component.options.middleware) 187 | } 188 | }) 189 | } 190 | 191 | midd = midd.map(name => { 192 | if (typeof name === 'function') return name 193 | if (typeof middleware[name] !== 'function') { 194 | unknownMiddleware = true 195 | this.error({ statusCode: 500, message: 'Unknown middleware ' + name }) 196 | } 197 | return middleware[name] 198 | }) 199 | 200 | if (unknownMiddleware) return 201 | return middlewareSeries(midd, context) 202 | } 203 | 204 | async function render (to, from, next) { 205 | if (this._pathChanged === false && this._queryChanged === false) return next() 206 | // Handle first render on SPA mode 207 | if (to === from) _lastPaths = [] 208 | else { 209 | const fromMatches = [] 210 | _lastPaths = getMatchedComponents(from, fromMatches).map((Component, i) => compile(from.matched[fromMatches[i]].path)(from.params)) 211 | } 212 | 213 | // nextCalled is true when redirected 214 | let nextCalled = false 215 | const _next = path => { 216 | if (from.path === path.path && this.$loading.finish) this.$loading.finish() 217 | if (from.path !== path.path && this.$loading.pause) this.$loading.pause() 218 | if (nextCalled) return 219 | nextCalled = true 220 | next(path) 221 | } 222 | 223 | // Update context 224 | await setContext(app, { 225 | route: to, 226 | from, 227 | next: _next.bind(this) 228 | }) 229 | this._dateLastError = app.nuxt.dateErr 230 | this._hadError = !!app.nuxt.err 231 | 232 | // Get route's matched components 233 | const matches = [] 234 | const Components = getMatchedComponents(to, matches) 235 | 236 | // If no Components matched, generate 404 237 | if (!Components.length) { 238 | // Default layout 239 | await callMiddleware.call(this, Components, app.context) 240 | if (nextCalled) return 241 | // Load layout for error page 242 | const layout = await this.loadLayout(typeof NuxtError.layout === 'function' ? NuxtError.layout(app.context) : NuxtError.layout) 243 | await callMiddleware.call(this, Components, app.context, layout) 244 | if (nextCalled) return 245 | // Show error page 246 | app.context.error({ statusCode: 404, message: 'This page could not be found' }) 247 | return next() 248 | } 249 | 250 | // Update ._data and other properties if hot reloaded 251 | Components.forEach(Component => { 252 | if (Component._Ctor && Component._Ctor.options) { 253 | Component.options.asyncData = Component._Ctor.options.asyncData 254 | Component.options.fetch = Component._Ctor.options.fetch 255 | } 256 | }) 257 | 258 | // Apply transitions 259 | this.setTransitions(mapTransitions(Components, to, from)) 260 | 261 | try { 262 | // Call middleware 263 | await callMiddleware.call(this, Components, app.context) 264 | if (nextCalled) return 265 | if (app.context._errored) return next() 266 | 267 | // Set layout 268 | let layout = Components[0].options.layout 269 | if (typeof layout === 'function') { 270 | layout = layout(app.context) 271 | } 272 | layout = await this.loadLayout(layout) 273 | 274 | // Call middleware for layout 275 | await callMiddleware.call(this, Components, app.context, layout) 276 | if (nextCalled) return 277 | if (app.context._errored) return next() 278 | 279 | // Call .validate() 280 | let isValid = true 281 | Components.forEach(Component => { 282 | if (!isValid) return 283 | if (typeof Component.options.validate !== 'function') return 284 | isValid = Component.options.validate(app.context) 285 | }) 286 | // ...If .validate() returned false 287 | if (!isValid) { 288 | this.error({ statusCode: 404, message: 'This page could not be found' }) 289 | return next() 290 | } 291 | 292 | // Call asyncData & fetch hooks on components matched by the route. 293 | await Promise.all(Components.map((Component, i) => { 294 | // Check if only children route changed 295 | Component._path = compile(to.matched[matches[i]].path)(to.params) 296 | Component._dataRefresh = false 297 | // Check if Component need to be refreshed (call asyncData & fetch) 298 | // Only if its slug has changed or is watch query changes 299 | if (this._pathChanged && Component._path !== _lastPaths[i]) { 300 | Component._dataRefresh = true 301 | } else if (!this._pathChanged && this._queryChanged) { 302 | const watchQuery = Component.options.watchQuery 303 | if (watchQuery === true) { 304 | Component._dataRefresh = true 305 | } else if (Array.isArray(watchQuery)) { 306 | Component._dataRefresh = watchQuery.some((key) => this._diffQuery[key]) 307 | } 308 | } 309 | if (!this._hadError && this._isMounted && !Component._dataRefresh) { 310 | return Promise.resolve() 311 | } 312 | 313 | let promises = [] 314 | 315 | const hasAsyncData = Component.options.asyncData && typeof Component.options.asyncData === 'function' 316 | const hasFetch = !!Component.options.fetch 317 | const loadingIncrease = (hasAsyncData && hasFetch) ? 30 : 45 318 | 319 | // Call asyncData(context) 320 | if (hasAsyncData) { 321 | const promise = promisify(Component.options.asyncData, app.context) 322 | .then(asyncDataResult => { 323 | applyAsyncData(Component, asyncDataResult) 324 | if(this.$loading.increase) this.$loading.increase(loadingIncrease) 325 | }) 326 | promises.push(promise) 327 | } 328 | 329 | // Call fetch(context) 330 | if (hasFetch) { 331 | let p = Component.options.fetch(app.context) 332 | if (!p || (!(p instanceof Promise) && (typeof p.then !== 'function'))) { 333 | p = Promise.resolve(p) 334 | } 335 | p.then(fetchResult => { 336 | if(this.$loading.increase) this.$loading.increase(loadingIncrease) 337 | }) 338 | promises.push(p) 339 | } 340 | 341 | return Promise.all(promises) 342 | })) 343 | 344 | // If not redirected 345 | if (!nextCalled) { 346 | if(this.$loading.finish) this.$loading.finish() 347 | next() 348 | } 349 | 350 | } catch (error) { 351 | if (!error) error = {} 352 | _lastPaths = [] 353 | error.statusCode = error.statusCode || error.status || (error.response && error.response.status) || 500 354 | 355 | // Load error layout 356 | let layout = NuxtError.layout 357 | if (typeof layout === 'function') { 358 | layout = layout(app.context) 359 | } 360 | await this.loadLayout(layout) 361 | 362 | this.error(error) 363 | this.$nuxt.$emit('routeChanged', to, from, error) 364 | next(false) 365 | } 366 | } 367 | 368 | // Fix components format in matched, it's due to code-splitting of vue-router 369 | function normalizeComponents (to, ___) { 370 | flatMapComponents(to, (Component, _, match, key) => { 371 | if (typeof Component === 'object' && !Component.options) { 372 | // Updated via vue-router resolveAsyncComponents() 373 | Component = Vue.extend(Component) 374 | Component._Ctor = Component 375 | match.components[key] = Component 376 | } 377 | return Component 378 | }) 379 | } 380 | 381 | function showNextPage(to) { 382 | // Hide error component if no error 383 | if (this._hadError && this._dateLastError === this.$options.nuxt.dateErr) { 384 | this.error() 385 | } 386 | 387 | // Set layout 388 | let layout = this.$options.nuxt.err ? NuxtError.layout : to.matched[0].components.default.options.layout 389 | if (typeof layout === 'function') { 390 | layout = layout(app.context) 391 | } 392 | this.setLayout(layout) 393 | } 394 | 395 | // When navigating on a different route but the same component is used, Vue.js 396 | // Will not update the instance data, so we have to update $data ourselves 397 | function fixPrepatch(to, ___) { 398 | if (this._pathChanged === false && this._queryChanged === false) return 399 | 400 | Vue.nextTick(() => { 401 | const matches = [] 402 | const instances = getMatchedComponentsInstances(to, matches) 403 | const Components = getMatchedComponents(to, matches) 404 | 405 | instances.forEach((instance, i) => { 406 | if (!instance) return 407 | // if (!this._queryChanged && to.matched[matches[i]].path.indexOf(':') === -1 && to.matched[matches[i]].path.indexOf('*') === -1) return // If not a dynamic route, skip 408 | if (instance.constructor._dataRefresh && Components[i] === instance.constructor && typeof instance.constructor.options.data === 'function') { 409 | const newData = instance.constructor.options.data.call(instance) 410 | for (let key in newData) { 411 | Vue.set(instance.$data, key, newData[key]) 412 | } 413 | } 414 | }) 415 | showNextPage.call(this, to) 416 | 417 | }) 418 | } 419 | 420 | function nuxtReady (_app) { 421 | window._nuxtReadyCbs.forEach((cb) => { 422 | if (typeof cb === 'function') { 423 | cb(_app) 424 | } 425 | }) 426 | // Special JSDOM 427 | if (typeof window._onNuxtLoaded === 'function') { 428 | window._onNuxtLoaded(_app) 429 | } 430 | // Add router hooks 431 | router.afterEach(function (to, from) { 432 | // Wait for fixPrepatch + $data updates 433 | Vue.nextTick(() => _app.$nuxt.$emit('routeChanged', to, from)) 434 | }) 435 | } 436 | 437 | 438 | 439 | async function mountApp(__app) { 440 | // Set global variables 441 | app = __app.app 442 | router = __app.router 443 | store = __app.store 444 | 445 | // Resolve route components 446 | const Components = await Promise.all(resolveComponents(router)) 447 | 448 | // Create Vue instance 449 | const _app = new Vue(app) 450 | 451 | 452 | // Load layout 453 | const layout = NUXT.layout || 'default' 454 | await _app.loadLayout(layout) 455 | _app.setLayout(layout) 456 | 457 | 458 | // Mounts Vue app to DOM element 459 | const mount = () => { 460 | _app.$mount('#__nuxt') 461 | 462 | // Listen for first Vue update 463 | Vue.nextTick(() => { 464 | // Call window.onNuxtReady callbacks 465 | nuxtReady(_app) 466 | 467 | }) 468 | } 469 | 470 | // Enable transitions 471 | _app.setTransitions = _app.$options.nuxt.setTransitions.bind(_app) 472 | if (Components.length) { 473 | _app.setTransitions(mapTransitions(Components, router.currentRoute)) 474 | _lastPaths = router.currentRoute.matched.map(route => compile(route.path)(router.currentRoute.params)) 475 | } 476 | 477 | // Initialize error handler 478 | _app.$loading = {} // To avoid error while _app.$nuxt does not exist 479 | if (NUXT.error) _app.error(NUXT.error) 480 | 481 | // Add router hooks 482 | router.beforeEach(loadAsyncComponents.bind(_app)) 483 | router.beforeEach(render.bind(_app)) 484 | router.afterEach(normalizeComponents) 485 | router.afterEach(fixPrepatch.bind(_app)) 486 | 487 | // If page already is server rendered 488 | if (NUXT.serverRendered) { 489 | mount() 490 | return 491 | } 492 | 493 | // First render on client-side 494 | render.call(_app, router.currentRoute, router.currentRoute, (path) => { 495 | // If not redirected 496 | if (!path) { 497 | normalizeComponents(router.currentRoute, router.currentRoute) 498 | showNextPage.call(_app, router.currentRoute) 499 | // Dont call fixPrepatch.call(_app, router.currentRoute, router.currentRoute) since it's first render 500 | mount() 501 | return 502 | } 503 | 504 | // Push the path and then mount app 505 | router.push(path, () => mount(), (err) => { 506 | if (!err) return mount() 507 | console.error(err) 508 | }) 509 | }) 510 | } 511 | -------------------------------------------------------------------------------- /src/.nuxt/components/no-ssr.js: -------------------------------------------------------------------------------- 1 | /* 2 | ** From https://github.com/egoist/vue-no-ssr 3 | ** With the authorization of @egoist 4 | */ 5 | export default { 6 | name: 'no-ssr', 7 | props: ['placeholder'], 8 | data () { 9 | return { 10 | canRender: false 11 | } 12 | }, 13 | mounted () { 14 | this.canRender = true 15 | }, 16 | render (h) { 17 | if (this.canRender) { 18 | if ( 19 | process.env.NODE_ENV === 'development' && 20 | this.$slots.default && 21 | this.$slots.default.length > 1 22 | ) { 23 | throw new Error(' You cannot use multiple child components') 24 | } 25 | return this.$slots.default && this.$slots.default[0] 26 | } 27 | 28 | return h( 29 | 'div', 30 | { 31 | class: ['no-ssr-placeholder'] 32 | }, 33 | this.$slots.placeholder || this.placeholder 34 | ) 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/.nuxt/components/nuxt-child.js: -------------------------------------------------------------------------------- 1 | export default { 2 | name: 'nuxt-child', 3 | functional: true, 4 | props: ['keepAlive'], 5 | render (h, { parent, data, props }) { 6 | data.nuxtChild = true 7 | const _parent = parent 8 | const transitions = parent.$nuxt.nuxt.transitions 9 | const defaultTransition = parent.$nuxt.nuxt.defaultTransition 10 | 11 | let depth = 0 12 | while (parent) { 13 | if (parent.$vnode && parent.$vnode.data.nuxtChild) { 14 | depth++ 15 | } 16 | parent = parent.$parent 17 | } 18 | data.nuxtChildDepth = depth 19 | const transition = transitions[depth] || defaultTransition 20 | let transitionProps = {} 21 | transitionsKeys.forEach((key) => { 22 | if (typeof transition[key] !== 'undefined') { 23 | transitionProps[key] = transition[key] 24 | } 25 | }) 26 | let listeners = {} 27 | listenersKeys.forEach((key) => { 28 | if (typeof transition[key] === 'function') { 29 | listeners[key] = transition[key].bind(_parent) 30 | } 31 | }) 32 | // Add triggerScroll event on beforeEnter (fix #1376) 33 | let beforeEnter = listeners.beforeEnter 34 | listeners.beforeEnter = (el) => { 35 | window.$nuxt.$emit('triggerScroll') 36 | if (beforeEnter) return beforeEnter.call(_parent, el) 37 | } 38 | 39 | let routerView = [ 40 | h('router-view', data) 41 | ] 42 | if (typeof props.keepAlive !== 'undefined') { 43 | routerView = [ 44 | h('keep-alive', routerView) 45 | ] 46 | } 47 | return h('transition', { 48 | props: transitionProps, 49 | on: listeners 50 | }, routerView) 51 | } 52 | } 53 | 54 | const transitionsKeys = [ 55 | 'name', 56 | 'mode', 57 | 'appear', 58 | 'css', 59 | 'type', 60 | 'duration', 61 | 'enterClass', 62 | 'leaveClass', 63 | 'appearClass', 64 | 'enterActiveClass', 65 | 'enterActiveClass', 66 | 'leaveActiveClass', 67 | 'appearActiveClass', 68 | 'enterToClass', 69 | 'leaveToClass', 70 | 'appearToClass' 71 | ] 72 | 73 | const listenersKeys = [ 74 | 'beforeEnter', 75 | 'enter', 76 | 'afterEnter', 77 | 'enterCancelled', 78 | 'beforeLeave', 79 | 'leave', 80 | 'afterLeave', 81 | 'leaveCancelled', 82 | 'beforeAppear', 83 | 'appear', 84 | 'afterAppear', 85 | 'appearCancelled' 86 | ] 87 | -------------------------------------------------------------------------------- /src/.nuxt/components/nuxt-error.vue: -------------------------------------------------------------------------------- 1 | 20 | 21 | 46 | 47 | 92 | -------------------------------------------------------------------------------- /src/.nuxt/components/nuxt-link.js: -------------------------------------------------------------------------------- 1 | export default { 2 | name: 'nuxt-link', 3 | functional: true, 4 | render (h, { data, children }) { 5 | return h('router-link', data, children) 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/.nuxt/components/nuxt-loading.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 89 | 90 | 104 | -------------------------------------------------------------------------------- /src/.nuxt/components/nuxt.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import NuxtChild from './nuxt-child' 3 | import NuxtError from './nuxt-error.vue' 4 | import { compile } from '../utils' 5 | 6 | export default { 7 | name: 'nuxt', 8 | props: ['nuxtChildKey', 'keepAlive'], 9 | render(h) { 10 | // If there is some error 11 | if (this.nuxt.err) { 12 | return h('nuxt-error', { 13 | props: { 14 | error: this.nuxt.err 15 | } 16 | }) 17 | } 18 | // Directly return nuxt child 19 | return h('nuxt-child', { 20 | key: this.routerViewKey, 21 | props: this.$props 22 | }) 23 | }, 24 | beforeCreate () { 25 | Vue.util.defineReactive(this, 'nuxt', this.$root.$options.nuxt) 26 | }, 27 | computed: { 28 | routerViewKey () { 29 | // If nuxtChildKey prop is given or current route has children 30 | if (typeof this.nuxtChildKey !== 'undefined' || this.$route.matched.length > 1) { 31 | return this.nuxtChildKey || compile(this.$route.matched[0].path)(this.$route.params) 32 | } 33 | const Component = this.$route.matched[0] && this.$route.matched[0].components.default 34 | if (Component && Component.options && Component.options.key) { 35 | return (typeof Component.options.key === 'function' ? Component.options.key(this.$route) : Component.options.key) 36 | } 37 | return this.$route.path 38 | } 39 | }, 40 | components: { 41 | NuxtChild, 42 | NuxtError 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/.nuxt/dist/2aa56ac0bcbbc141d9ca.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[0],{145:function(t,e,r){var o=r(146);"string"==typeof o&&(o=[[t.i,o,""]]),o.locals&&(t.exports=o.locals);(0,r(18).default)("7e192dca",o,!1,{sourceMap:!1})},146:function(t,e,r){(t.exports=r(19)(!1)).push([t.i,".VueToNuxtLogo{display:inline-block;-webkit-animation:turn 2s linear forwards 1s;animation:turn 2s linear forwards 1s;-webkit-transform:rotateX(180deg);transform:rotateX(180deg);position:relative;overflow:hidden;height:180px;width:245px;left:13px}.Triangle{position:absolute;top:0;left:0;width:0;height:0}.Triangle--one{border-left:105px solid transparent;border-right:105px solid transparent;border-bottom:180px solid #41b883}.Triangle--two{top:30px;border-left:87.5px solid transparent;border-right:87.5px solid transparent;border-bottom:150px solid #3b8070}.Triangle--three,.Triangle--two{left:35px;-webkit-animation:goright .5s linear forwards 3.5s;animation:goright .5s linear forwards 3.5s}.Triangle--three{top:60px;border-left:70px solid transparent;border-right:70px solid transparent;border-bottom:120px solid #35495e}.Triangle--four{top:120px;left:70px;-webkit-animation:godown .5s linear forwards 3s;animation:godown .5s linear forwards 3s;border-left:35px solid transparent;border-right:35px solid transparent;border-bottom:60px solid #fff}@-webkit-keyframes turn{to{-webkit-transform:rotateX(0deg);transform:rotateX(0deg)}}@keyframes turn{to{-webkit-transform:rotateX(0deg);transform:rotateX(0deg)}}@-webkit-keyframes godown{to{top:180px}}@keyframes godown{to{top:180px}}@-webkit-keyframes goright{to{left:70px}}@keyframes goright{to{left:70px}}",""])},147:function(t,e,r){"use strict";var o=r(145);r.n(o).a},150:function(t,e,r){"use strict";r.r(e);var o=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("section",{staticClass:"container"},[r("div",[r("logo"),t._v(" "),r("h1",{staticClass:"mui--text-display1"},[t._v("Nuxt2 - SSR - Firebase Functions")]),t._v(" "),r("h2",{staticClass:"headline"},[t._v("Rendered From:"),r("span",{staticClass:"render-result"},[t._v(t._s(t.renderSource))])]),t._v(" "),r("button",{staticClass:"mui-btn mui-btn--primary",attrs:{id:"reload-btn"},on:{click:t.reloadPage}},[t._v("\n Reload Page\n ")])],1)])};o._withStripped=!0;var a=function(){var t=this.$createElement;this._self._c;return this._m(0)};a._withStripped=!0;r(147);var i=r(7),n={asyncData:function(){return{renderSource:"client"}},components:{Logo:Object(i.a)({},a,[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"VueToNuxtLogo"},[e("div",{staticClass:"Triangle Triangle--two"}),this._v(" "),e("div",{staticClass:"Triangle Triangle--one"}),this._v(" "),e("div",{staticClass:"Triangle Triangle--three"}),this._v(" "),e("div",{staticClass:"Triangle Triangle--four"})])}],!1,null,null,null).exports},methods:{reloadPage:function(){window.location.reload()}}},s=Object(i.a)(n,o,[],!1,null,null,null);e.default=s.exports}}]); -------------------------------------------------------------------------------- /src/.nuxt/dist/6f77ffcd15ddb20c4434.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[1],{148:function(t,e,n){"use strict";n.r(e);var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("section",{staticClass:"container"},[n("div",[n("h1",{staticClass:"mui--text-display1"},[t._v("Page 2")]),t._v(" "),n("h2",{staticClass:"headline"},[t._v("Rendered From:"),n("span",{staticClass:"render-result"},[t._v(t._s(t.renderSource))])]),t._v(" "),n("button",{staticClass:"mui-btn mui-btn--primary",attrs:{id:"reload-btn"},on:{click:t.reloadPage}},[t._v("\n Reload Page\n ")])])])};a._withStripped=!0;var r=n(1),s=n.n(r),i=n(6),c=n.n(i),o={asyncData:function(){var t=c()(s.a.mark(function t(){return s.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",{renderSource:"client"});case 1:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}(),methods:{reloadPage:function(){window.location.reload()}}},u=n(7),l=Object(u.a)(o,a,[],!1,null,null,null);e.default=l.exports}}]); -------------------------------------------------------------------------------- /src/.nuxt/dist/LICENSES: -------------------------------------------------------------------------------- 1 | /*! 2 | * Vue.js v2.5.16 3 | * (c) 2014-2018 Evan You 4 | * Released under the MIT License. 5 | */ 6 | 7 | /** 8 | * vuex v3.0.1 9 | * (c) 2017 Evan You 10 | * @license MIT 11 | */ 12 | 13 | /** 14 | * vue-router v3.0.1 15 | * (c) 2017 Evan You 16 | * @license MIT 17 | */ 18 | 19 | /** 20 | * vue-meta v1.5.0 21 | * (c) 2018 Declan de Wet & Atinux 22 | * @license MIT 23 | */ 24 | 25 | /* 26 | object-assign 27 | (c) Sindre Sorhus 28 | @license MIT 29 | */ 30 | 31 | /*! 32 | * @overview es6-promise - a tiny implementation of Promises/A+. 33 | * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) 34 | * @license Licensed under MIT license 35 | * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE 36 | * @version v4.2.4+314e4831 37 | */ 38 | -------------------------------------------------------------------------------- /src/.nuxt/dist/a95365ffe4047e6094dd.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[2],{149:function(t,e,n){"use strict";n.r(e);var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("section",{staticClass:"container"},[n("div",[n("h1",{staticClass:"mui--text-display1"},[t._v("Page 3")]),t._v(" "),n("h2",{staticClass:"headline"},[t._v("Rendered From:"),n("span",{staticClass:"render-result"},[t._v(t._s(t.renderSource))])]),t._v(" "),n("button",{staticClass:"mui-btn mui-btn--primary",attrs:{id:"reload-btn"},on:{click:t.reloadPage}},[t._v("\n Reload Page\n ")])])])};a._withStripped=!0;var r=n(1),s=n.n(r),i=n(6),c=n.n(i),o={asyncData:function(){var t=c()(s.a.mark(function t(){return s.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",{renderSource:"client"});case 1:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}(),methods:{reloadPage:function(){window.location.reload()}}},u=n(7),l=Object(u.a)(o,a,[],!1,null,null,null);e.default=l.exports}}]); -------------------------------------------------------------------------------- /src/.nuxt/dist/d97ee76b6641d6111716.js: -------------------------------------------------------------------------------- 1 | !function(t){function e(e){for(var r,i,s=e[0],u=e[1],c=e[2],l=0,f=[];ln.parts.length&&(r.parts.length=n.parts.length)}else{var i=[];for(o=0;o1&&void 0!==arguments[1]&&arguments[1];return[].concat.apply([],t.matched.map(function(t,n){return h()(t.components).map(function(r){return e&&e.push(n),t.components[r]})}))}function et(t,e){return Array.prototype.concat.apply([],t.matched.map(function(t,n){return h()(t.components).map(function(r){return e(t.components[r],t.instances[r],t,r,n)})}))}function nt(t){var e,n=this;return i.a.all(et(t,(e=f()(u.a.mark(function t(e,r,o,a){return u.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if("function"!=typeof e||e.options){t.next=4;break}return t.next=3,e();case 3:e=t.sent;case 4:return t.abrupt("return",o.components[a]=Y(e));case 5:case"end":return t.stop()}},t,n)})),function(t,n,r,o){return e.apply(this,arguments)})))}window._nuxtReadyCbs=[],window.onNuxtReady=function(t){window._nuxtReadyCbs.push(t)};var rt,ot,at=(rt=f()(u.a.mark(function t(e){return u.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,nt(e);case 2:return t.abrupt("return",O()({},e,{meta:tt(e).map(function(t){return t.options.meta||{}})}));case 3:case"end":return t.stop()}},t,this)})),function(t){return rt.apply(this,arguments)}),it=(ot=f()(u.a.mark(function t(e,n){return u.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n.to?n.to:n.route,e.context||(e.context={isStatic:!1,isDev:!1,isHMR:!1,app:e,store:e.store,payload:n.payload,error:n.error,base:"/",env:{}},n.req&&(e.context.req=n.req),n.res&&(e.context.res=n.res),e.context.redirect=function(t,n,r){if(t){e.context._redirected=!0;var a=void 0===n?"undefined":o()(n);if("number"==typeof t||"undefined"!==a&&"object"!==a||(r=n||{},a=void 0===(n=t)?"undefined":o()(n),t=302),"object"===a&&(n=e.router.resolve(n).href),!/(^[.]{1,2}\/)|(^\/(?!\/))/.test(n))throw n=mt(n,r),window.location.replace(n),new Error("ERR_REDIRECT");e.context.next({path:n,query:r,status:t})}},e.context.nuxtState=window.__NUXT__),e.context.next=n.next,e.context._redirected=!1,e.context._errored=!1,e.context.isHMR=!!n.isHMR,!n.route){t.next=10;break}return t.next=9,at(n.route);case 9:e.context.route=t.sent;case 10:if(e.context.params=e.context.route.params||{},e.context.query=e.context.route.query||{},!n.from){t.next=16;break}return t.next=15,at(n.from);case 15:e.context.from=t.sent;case 16:case"end":return t.stop()}},t,this)})),function(t,e){return ot.apply(this,arguments)});function st(t,e){var n=void 0;return(n=2===t.length?new i.a(function(n){t(e,function(t,r){t&&e.error(t),n(r=r||{})})}):t(e))&&(n instanceof i.a||"function"==typeof n.then)||(n=i.a.resolve(n)),n}function ut(t,e){var n=window.location.pathname;return"hash"===e?window.location.hash.replace(/^#\//,""):(t&&0===n.indexOf(t)&&(n=n.slice(t.length)),(n||"/")+window.location.search+window.location.hash)}function ct(t,e){return function(t){for(var e=new Array(t.length),n=0;n1)return this.nuxtChildKey||ct(this.$route.matched[0].path)(this.$route.params);var t=this.$route.matched[0]&&this.$route.matched[0].components.default;return t&&t.options&&t.options.key?"function"==typeof t.options.key?t.options.key(this.$route):t.options.key:this.$route.path}},components:{NuxtChild:F,NuxtError:G}},xt=function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"nuxt-progress",style:{width:this.percent+"%",height:this.height,"background-color":this.canSuccess?this.color:this.failedColor,opacity:this.show?1:0}})};xt._withStripped=!0;var gt={name:"nuxt-loading",data:function(){return{percent:0,show:!1,canSuccess:!0,duration:5e3,height:"2px",color:"#3B8070",failedColor:"red"}},methods:{start:function(){var t=this;return this.show=!0,this.canSuccess=!0,this._timer&&(clearInterval(this._timer),this.percent=0),this._cut=1e4/Math.floor(this.duration),this._timer=setInterval(function(){t.increase(t._cut*Math.random()),t.percent>95&&t.finish()},100),this},set:function(t){return this.show=!0,this.canSuccess=!0,this.percent=Math.floor(t),this},get:function(){return Math.floor(this.percent)},increase:function(t){return this.percent=this.percent+Math.floor(t),this},decrease:function(t){return this.percent=this.percent-Math.floor(t),this},finish:function(){return this.percent=100,this.hide(),this},pause:function(){return clearInterval(this._timer),this},hide:function(){var t=this;return clearInterval(this._timer),this._timer=null,setTimeout(function(){t.show=!1,x.a.nextTick(function(){setTimeout(function(){t.percent=0},200)})},500),this},fail:function(){return this.canSuccess=!1,this}}},yt=(n(91),Object(W.a)(gt,xt,[],!1,null,null,null).exports),wt=(n(89),function(){var t=this.$createElement,e=this._self._c||t;return e("div",{attrs:{id:"app-wrapper"}},[e("app-header"),this._v(" "),e("div",{staticClass:"mui--text-center",attrs:{id:"content-wrapper"}},[e("nuxt",{staticClass:"mui-container"})],1),this._v(" "),e("app-footer")],1)});wt._withStripped=!0;var bt=function(){var t=this.$createElement;this._self._c;return this._m(0)};bt._withStripped=!0;var _t={name:"AppFooter"},Ct=(n(87),Object(W.a)(_t,bt,[function(){var t=this.$createElement,e=this._self._c||t;return e("footer",[e("div",{staticClass:"mui-container mui--text-center"},[e("div",{staticClass:"footer-flex-item"},[e("strong",[this._v("Nuxt2SSRFire: ")]),this._v("Made by "),e("a",{attrs:{href:"https://www.davidroyer.me",target:"_blank"}},[this._v("David Royer")])]),this._v(" "),e("div",{staticClass:"footer-flex-item"},[this._v("\n Check out this project's "),e("a",{attrs:{href:"https://github.com/davidroyer/nuxt-ssr-firebase",target:"_blank"}},[this._v("Github Repo")])])])])}],!1,null,null,null).exports),kt=function(){var t=this.$createElement,e=this._self._c||t;return e("header",{staticClass:"mui-appbar mui--z1"},[e("nav",[e("nuxt-link",{attrs:{to:"/"}},[this._v("Home")]),this._v(" "),e("nuxt-link",{attrs:{to:"/page2"}},[this._v("Page 2")]),this._v(" "),e("nuxt-link",{attrs:{to:"/page3"}},[this._v("Page 3")])],1)])};kt._withStripped=!0;var $t={name:"AppHeader"},Et=(n(85),{components:{AppHeader:Object(W.a)($t,kt,[],!1,null,null,null).exports,AppFooter:Ct},methods:{reloadPage:function(){window.location.reload()}}}),Rt=(n(83),{_default:Object(W.a)(Et,wt,[],!1,null,null,null).exports}),St={head:{title:"Nuxtjs SSR on Firebase Functions",meta:[{charset:"utf-8"},{name:"viewport",content:"width=device-width, initial-scale=1"},{hid:"description",name:"description",content:"Nuxt.js project"},{hid:"mobile-web-app-capable",name:"mobile-web-app-capable",content:"yes"},{hid:"apple-mobile-web-app-title",name:"apple-mobile-web-app-title",content:"nuxt-ssr-firebase-source"},{hid:"theme-color",name:"theme-color",content:"#3B8070"},{hid:"og:type",name:"og:type",property:"og:type",content:"website"},{hid:"og:title",name:"og:title",property:"og:title",content:"nuxt-ssr-firebase-source"},{hid:"og:description",name:"og:description",property:"og:description",content:"> Nuxt.js project"}],link:[{rel:"icon",type:"image/x-icon",href:"/favicon.ico"},{rel:"stylesheet",href:"https://fonts.googleapis.com/css?family=Roboto"},{rel:"stylesheet",href:"https://cdn.muicss.com/mui-0.9.35/css/mui.min.css"},{rel:"manifest",href:"/assets/manifest.18c4f7f1.json"},{rel:"shortcut icon",href:"/assets/icons/icon_64.9qid3ZBUcQn.png"},{rel:"apple-touch-icon",href:"/assets/icons/icon_512.9qid3ZBUcQn.png",sizes:"512x512"}],style:[],script:[],htmlAttrs:{lang:"en"}},render:function(t,e){var n=t("nuxt-loading",{ref:"loading"}),r=t(this.layout||"nuxt");return t("div",{domProps:{id:"__nuxt"}},[n,t("transition",{props:{name:"layout",mode:"out-in"}},[t("div",{domProps:{id:"__layout"},key:this.layoutName},[r])])])},data:function(){return{layout:null,layoutName:""}},beforeCreate:function(){x.a.util.defineReactive(this,"nuxt",this.$options.nuxt)},created:function(){x.a.prototype.$nuxt=this,"undefined"!=typeof window&&(window.$nuxt=this),this.error=this.nuxt.error},mounted:function(){this.$loading=this.$refs.loading},watch:{"nuxt.err":"errorChanged"},methods:{errorChanged:function(){this.nuxt.err&&this.$loading&&(this.$loading.fail&&this.$loading.fail(),this.$loading.finish&&this.$loading.finish())},setLayout:function(t){return t&&Rt["_"+t]||(t="default"),this.layoutName=t,this.layout=Rt["_"+t],this.layout},loadLayout:function(t){return t&&Rt["_"+t]||(t="default"),i.a.resolve(Rt["_"+t])}},components:{NuxtLoading:yt}},jt=n(56);x.a.use(jt.a);var Tt=n(93),At=Tt.keys(),Nt={},Mt=void 0;if(At.forEach(function(t){-1!==t.indexOf("./index.")&&(Mt=t)}),Mt&&(Nt=Ht(Mt)),"function"!=typeof Nt){Nt.modules||(Nt.modules={});var Ot=!0,Ut=!1,Lt=void 0;try{for(var qt,Dt=y()(At);!(Ot=(qt=Dt.next()).done);Ot=!0){var zt=qt.value,Bt=zt.replace(/^\.\//,"").replace(/\.(mjs|js)$/,"");if("index"!==Bt){var Pt=Bt.split(/\//),It=Qt(Nt,Pt);It[Bt=Pt.pop()]=Ht(zt),It[Bt].namespaced=!0}}}catch(t){Ut=!0,Lt=t}finally{try{!Ot&&Dt.return&&Dt.return()}finally{if(Ut)throw Lt}}}var Ft=Nt instanceof Function?Nt:function(){return new jt.a.Store(v()({strict:!1},Nt,{state:Nt.state instanceof Function?Nt.state():{}}))};function Ht(t){var e=Tt(t),n=e.default||e;if(n.commit)throw new Error("[nuxt] store/"+t.replace("./","")+" should export a method which returns a Vuex instance.");if(n.state&&"function"!=typeof n.state)throw new Error("[nuxt] state should be a function in store/"+t.replace("./",""));return n}function Qt(t,e){if(1===e.length)return t.modules;var n=e.shift();return t.modules[n]=t.modules[n]||{},t.modules[n].namespaced=!0,t.modules[n].modules=t.modules[n].modules||{},Qt(t.modules[n],e)}var Kt,Xt=n(55),Jt=n.n(Xt),Wt=(Kt=f()(u.a.mark(function t(e){var n,r,o,a,i,s,c;return u.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,new q.a({mode:"history",base:"/",linkActiveClass:"nuxt-link-active",linkExactActiveClass:"nuxt-link-exact-active",scrollBehavior:P,routes:[{path:"/page3",component:D,name:"page3"},{path:"/page2",component:z,name:"page2"},{path:"/",component:B,name:"index"}],fallback:!1});case 2:return n=t.sent,(r=Ft(e)).$router=n,o=O()({router:n,store:r,nuxt:{defaultTransition:Vt,transitions:[Vt],setTransitions:function(t){return Array.isArray(t)||(t=[t]),t=t.map(function(t){return t=t?"string"==typeof t?v()({},Vt,{name:t}):v()({},Vt,t):Vt}),this.$options.nuxt.transitions=t,t},err:null,dateErr:null,error:function(t){t=t||null,o.context._errored=!!t,"string"==typeof t&&(t={statusCode:500,message:t});var n=this.nuxt||this.$options.nuxt;return n.dateErr=Date.now(),n.err=t,e&&(e.nuxt.error=t),t}}},St),r.app=o,a=e?e.next:function(t){return o.router.push(t)},i=void 0,e?i=n.resolve(e.url).route:(s=ut(n.options.base),i=n.resolve(s).route),t.next=12,it(o,{route:i,next:a,error:o.nuxt.error.bind(o),store:r,payload:e?e.payload:void 0,req:e?e.req:void 0,res:e?e.res:void 0,beforeRenderFns:e?e.beforeRenderFns:void 0});case 12:if(c=function(t,e){if(!t)throw new Error("inject(key, value) has no key provided");if(!e)throw new Error("inject(key, value) has no value provided");o[t="$"+t]=e,r[t]=o[t];var n="__nuxt_"+t+"_installed__";x.a[n]||(x.a[n]=!0,x.a.use(function(){x.a.prototype.hasOwnProperty(t)||N()(x.a.prototype,t,{get:function(){return this.$root.$options[t]}})}))},window.__NUXT__&&window.__NUXT__.state&&r.replaceState(window.__NUXT__.state),"function"!=typeof Jt.a){t.next=18;break}return t.next=18,Jt()(o.context,c);case 18:t.next=21;break;case 21:return t.abrupt("return",{app:o,router:n,store:r});case 22:case"end":return t.stop()}},t,this)})),function(t){return Kt.apply(this,arguments)});x.a.component(I.name,I),x.a.component(F.name,F),x.a.component(K.name,K),x.a.component(vt.name,vt),x.a.use(L.a,{keyName:"head",attribute:"data-n-head",ssrAttribute:"data-n-head-ssr",tagIDKeyName:"hid"});var Gt,Vt={name:"page",mode:"out-in",appear:!1,appearClass:"appear",appearActiveClass:"appear-active",appearToClass:"appear-to"},Zt=function(){var t=f()(u.a.mark(function t(e,n,r){var o,a,i=this;return u.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return this._pathChanged=!!ne.nuxt.err||n.path!==e.path,this._queryChanged=p()(e.query)!==p()(n.query),this._diffQuery=this._queryChanged?pt(e.query,n.query):[],this._pathChanged&&this.$loading.start&&this.$loading.start(),t.prev=4,t.next=7,nt(e);case 7:o=t.sent,!this._pathChanged&&this._queryChanged&&o.some(function(t){var e=t.options.watchQuery;return!0===e||!!Array.isArray(e)&&e.some(function(t){return i._diffQuery[t]})})&&this.$loading.start&&this.$loading.start(),r(),t.next=19;break;case 12:t.prev=12,t.t0=t.catch(4),t.t0=t.t0||{},a=t.t0.statusCode||t.t0.status||t.t0.response&&t.t0.response.status||500,this.error({statusCode:a,message:t.t0.message}),this.$nuxt.$emit("routeChanged",e,n,t.t0),r(!1);case 19:case"end":return t.stop()}},t,this,[[4,12]])}));return function(e,n,r){return t.apply(this,arguments)}}(),Yt=function(){var t=f()(u.a.mark(function t(e,n,r){var o,a,s,c,p,l,f,d,h,m=this;return u.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!1!==this._pathChanged||!1!==this._queryChanged){t.next=2;break}return t.abrupt("return",r());case 2:return ee=e===n?[]:tt(n,o=[]).map(function(t,e){return ct(n.matched[o[e]].path)(n.params)}),a=!1,s=function(t){n.path===t.path&&m.$loading.finish&&m.$loading.finish(),n.path!==t.path&&m.$loading.pause&&m.$loading.pause(),a||(a=!0,r(t))},t.next=7,it(ne,{route:e,from:n,next:s.bind(this)});case 7:if(this._dateLastError=ne.nuxt.dateErr,this._hadError=!!ne.nuxt.err,(p=tt(e,c=[])).length){t.next=25;break}return t.next=14,ce.call(this,p,ne.context);case 14:if(!a){t.next=16;break}return t.abrupt("return");case 16:return t.next=18,this.loadLayout("function"==typeof G.layout?G.layout(ne.context):G.layout);case 18:return l=t.sent,t.next=21,ce.call(this,p,ne.context,l);case 21:if(!a){t.next=23;break}return t.abrupt("return");case 23:return ne.context.error({statusCode:404,message:"This page could not be found"}),t.abrupt("return",r());case 25:return p.forEach(function(t){t._Ctor&&t._Ctor.options&&(t.options.asyncData=t._Ctor.options.asyncData,t.options.fetch=t._Ctor.options.fetch)}),this.setTransitions(ie(p,e,n)),t.prev=27,t.next=30,ce.call(this,p,ne.context);case 30:if(!a){t.next=32;break}return t.abrupt("return");case 32:if(!ne.context._errored){t.next=34;break}return t.abrupt("return",r());case 34:return"function"==typeof(f=p[0].options.layout)&&(f=f(ne.context)),t.next=38,this.loadLayout(f);case 38:return f=t.sent,t.next=41,ce.call(this,p,ne.context,f);case 41:if(!a){t.next=43;break}return t.abrupt("return");case 43:if(!ne.context._errored){t.next=45;break}return t.abrupt("return",r());case 45:if(d=!0,p.forEach(function(t){d&&"function"==typeof t.options.validate&&(d=t.options.validate(ne.context))}),d){t.next=50;break}return this.error({statusCode:404,message:"This page could not be found"}),t.abrupt("return",r());case 50:return t.next=52,i.a.all(p.map(function(t,n){if(t._path=ct(e.matched[c[n]].path)(e.params),t._dataRefresh=!1,m._pathChanged&&t._path!==ee[n])t._dataRefresh=!0;else if(!m._pathChanged&&m._queryChanged){var r=t.options.watchQuery;!0===r?t._dataRefresh=!0:Array.isArray(r)&&(t._dataRefresh=r.some(function(t){return m._diffQuery[t]}))}if(!m._hadError&&m._isMounted&&!t._dataRefresh)return i.a.resolve();var o=[],a=t.options.asyncData&&"function"==typeof t.options.asyncData,s=!!t.options.fetch,u=a&&s?30:45;if(a){var p=st(t.options.asyncData,ne.context).then(function(e){Z(t,e),m.$loading.increase&&m.$loading.increase(u)});o.push(p)}if(s){var l=t.options.fetch(ne.context);l&&(l instanceof i.a||"function"==typeof l.then)||(l=i.a.resolve(l)),l.then(function(t){m.$loading.increase&&m.$loading.increase(u)}),o.push(l)}return i.a.all(o)}));case 52:a||(this.$loading.finish&&this.$loading.finish(),r()),t.next=67;break;case 55:return t.prev=55,t.t0=t.catch(27),t.t0||(t.t0={}),ee=[],t.t0.statusCode=t.t0.statusCode||t.t0.status||t.t0.response&&t.t0.response.status||500,"function"==typeof(h=G.layout)&&(h=h(ne.context)),t.next=64,this.loadLayout(h);case 64:this.error(t.t0),this.$nuxt.$emit("routeChanged",e,n,t.t0),r(!1);case 67:case"end":return t.stop()}},t,this,[[27,55]])}));return function(e,n,r){return t.apply(this,arguments)}}(),te=(Gt=f()(u.a.mark(function t(e){var n,r,o,a;return u.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return ne=e.app,re=e.router,e.store,t.next=5,i.a.all(ue(re));case 5:return n=t.sent,r=new x.a(ne),o=oe.layout||"default",t.next=10,r.loadLayout(o);case 10:if(r.setLayout(o),a=function(){r.$mount("#__nuxt"),x.a.nextTick(function(){de(r)})},r.setTransitions=r.$options.nuxt.setTransitions.bind(r),n.length&&(r.setTransitions(ie(n,re.currentRoute)),ee=re.currentRoute.matched.map(function(t){return ct(t.path)(re.currentRoute.params)})),r.$loading={},oe.error&&r.error(oe.error),re.beforeEach(Zt.bind(r)),re.beforeEach(Yt.bind(r)),re.afterEach(pe),re.afterEach(fe.bind(r)),!oe.serverRendered){t.next=23;break}return a(),t.abrupt("return");case 23:Yt.call(r,re.currentRoute,re.currentRoute,function(t){if(!t)return pe(re.currentRoute,re.currentRoute),le.call(r,re.currentRoute),void a();re.push(t,function(){return a()},function(t){if(!t)return a();console.error(t)})});case 24:case"end":return t.stop()}},t,this)})),function(t){return Gt.apply(this,arguments)}),ee=[],ne=void 0,re=void 0,oe=window.__NUXT__||{},ae=x.a.config.errorHandler;function ie(t,e,n){var r=function(t){var r=function(t,e){if(!t||!t.options||!t.options[e])return{};var n=t.options[e];if("function"==typeof n){for(var r=arguments.length,o=Array(r>2?r-2:0),a=2;a1&&void 0!==arguments[1]&&arguments[1];return[].concat.apply([],t.matched.map(function(t,n){return h()(t.instances).map(function(r){return e&&e.push(n),t.instances[r]})}))}(t,e),o=tt(t,e);r.forEach(function(t,e){if(t&&t.constructor._dataRefresh&&o[e]===t.constructor&&"function"==typeof t.constructor.options.data){var n=t.constructor.options.data.call(t);for(var r in n)x.a.set(t.$data,r,n[r])}}),le.call(n,t)})}function de(t){window._nuxtReadyCbs.forEach(function(e){"function"==typeof e&&e(t)}),"function"==typeof window._onNuxtLoaded&&window._onNuxtLoaded(t),re.afterEach(function(e,n){x.a.nextTick(function(){return t.$nuxt.$emit("routeChanged",e,n)})})}x.a.config.errorHandler=function(t,e,n){var r={statusCode:t.statusCode||t.name||"Whoops!",message:t.message||t.toString()},o=null;return"function"==typeof ae&&(o=ae.apply(void 0,arguments)),!0===o?o:(e&&e.$root&&e.$root.$nuxt&&e.$root.$nuxt.error&&"render function"!==n&&e.$root.$nuxt.error(r),"function"==typeof ae?o:void console.error(t.message||r.message))},Wt().then(te).catch(function(t){"ERR_REDIRECT"!==t.message&&console.error("[nuxt] Error while initializing app",t)})},77:function(t,e){function n(t){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}n.keys=function(){return[]},n.resolve=n,t.exports=n,n.id=77},78:function(t,e,n){(t.exports=n(19)(!1)).push([t.i,".__nuxt-error-page{padding:1rem;background:#f7f8fb;color:#47494e;text-align:center;display:flex;justify-content:center;align-items:center;flex-direction:column;font-family:sans-serif;font-weight:100!important;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;-webkit-font-smoothing:antialiased;position:absolute;top:0;left:0;right:0;bottom:0}.__nuxt-error-page .error{max-width:450px}.__nuxt-error-page .title{font-size:1.5rem;margin-top:15px;color:#47494e;margin-bottom:8px}.__nuxt-error-page .description{color:#7f828b;line-height:21px;margin-bottom:10px}.__nuxt-error-page a{color:#7f828b!important;text-decoration:none}.__nuxt-error-page .logo{position:fixed;left:12px;bottom:12px}",""])},79:function(t,e,n){"use strict";var r=n(34);n.n(r).a},82:function(t,e,n){(t.exports=n(19)(!1)).push([t.i,"#app-wrapper{display:flex;min-height:100vh;flex-direction:column}",""])},83:function(t,e,n){"use strict";var r=n(35);n.n(r).a},84:function(t,e,n){(t.exports=n(19)(!1)).push([t.i,"footer{box-sizing:border-box;background-color:#eee;border-top:1px solid #e0e0e0;padding:.5em 0;display:flex;align-items:center}.footer-flex-item{margin:.5em}",""])},85:function(t,e,n){"use strict";var r=n(36);n.n(r).a},86:function(t,e,n){(t.exports=n(19)(!1)).push([t.i,"footer{box-sizing:border-box;background-color:#eee;border-top:1px solid #e0e0e0;padding:.5em 0;display:flex;align-items:center;position:fixed;bottom:0;left:0;right:0;height:65px;z-index:99}.footer-flex-item{margin:.5em}",""])},87:function(t,e,n){"use strict";var r=n(37);n.n(r).a},88:function(t,e,n){(t.exports=n(19)(!1)).push([t.i,".mui-appbar{background-color:#424242;color:#fff}.page-enter-active,.page-leave-active{transition:all .45s ease-in-out;transition:all .45s cubic-bezier(.55,0,.1,1)}.page-enter,.page-leave-active{opacity:0;-webkit-transform:translate(10px);transform:translate(10px)}nav{display:flex;flex-flow:row wrap;max-width:500px;margin-left:auto;margin-right:auto;align-items:center;height:64px;max-width:450px;justify-content:center}nav a{color:#f9f9f9;font-weight:400;font-size:1.1em;margin:0 1.5em;border-bottom:2px solid transparent;transition:all .2s ease;text-decoration:none!important;padding:.5em 1em}nav a:focus,nav a:hover{border-bottom:3px solid rgba(195,230,217,.47059)}.nuxt-link-exact-active{font-weight:700;text-decoration:none}.nuxt-link-exact-active,.nuxt-link-exact-active:focus,.nuxt-link-exact-active:hover{border-bottom:3px solid #2196f3}div#content-wrapper{margin:1em 0;padding:1.5em .5em 2.5em;display:flex;flex:1}@media (max-width:699px){div#content-wrapper{padding:1em 0 8em}}span.render-result{text-transform:capitalize;color:#424242;font-style:italic;font-weight:600;margin-left:.5em}#content-wrapper .headline{margin-top:2em}@media (max-width:849px){nav{justify-content:space-around}nav a{margin:0 .5em}}",""])},89:function(t,e,n){var r=n(88);"string"==typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);(0,n(18).default)("4d3c9d21",r,!1,{sourceMap:!1})},90:function(t,e,n){(t.exports=n(19)(!1)).push([t.i,".nuxt-progress{position:fixed;top:0;left:0;right:0;height:2px;width:0;transition:width .2s,opacity .4s;opacity:1;background-color:#efc14e;z-index:999999}",""])},91:function(t,e,n){"use strict";var r=n(38);n.n(r).a},92:function(t,e){},93:function(t,e,n){var r={"./index.js":92};function o(t){var e=a(t);return n(e)}function a(t){var e=r[t];if(!(e+1)){var n=new Error("Cannot find module '"+t+"'");throw n.code="MODULE_NOT_FOUND",n}return e}o.keys=function(){return Object.keys(r)},o.resolve=a,t.exports=o,o.id=93}}); -------------------------------------------------------------------------------- /src/.nuxt/dist/icons/icon_120.9qid3ZBUcQn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidroyer/nuxt2-ssr-firebase/c7fce7b4b83d5b05671beab59cd943539c378b46/src/.nuxt/dist/icons/icon_120.9qid3ZBUcQn.png -------------------------------------------------------------------------------- /src/.nuxt/dist/icons/icon_144.9qid3ZBUcQn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidroyer/nuxt2-ssr-firebase/c7fce7b4b83d5b05671beab59cd943539c378b46/src/.nuxt/dist/icons/icon_144.9qid3ZBUcQn.png -------------------------------------------------------------------------------- /src/.nuxt/dist/icons/icon_152.9qid3ZBUcQn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidroyer/nuxt2-ssr-firebase/c7fce7b4b83d5b05671beab59cd943539c378b46/src/.nuxt/dist/icons/icon_152.9qid3ZBUcQn.png -------------------------------------------------------------------------------- /src/.nuxt/dist/icons/icon_192.9qid3ZBUcQn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidroyer/nuxt2-ssr-firebase/c7fce7b4b83d5b05671beab59cd943539c378b46/src/.nuxt/dist/icons/icon_192.9qid3ZBUcQn.png -------------------------------------------------------------------------------- /src/.nuxt/dist/icons/icon_384.9qid3ZBUcQn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidroyer/nuxt2-ssr-firebase/c7fce7b4b83d5b05671beab59cd943539c378b46/src/.nuxt/dist/icons/icon_384.9qid3ZBUcQn.png -------------------------------------------------------------------------------- /src/.nuxt/dist/icons/icon_512.9qid3ZBUcQn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidroyer/nuxt2-ssr-firebase/c7fce7b4b83d5b05671beab59cd943539c378b46/src/.nuxt/dist/icons/icon_512.9qid3ZBUcQn.png -------------------------------------------------------------------------------- /src/.nuxt/dist/icons/icon_64.9qid3ZBUcQn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidroyer/nuxt2-ssr-firebase/c7fce7b4b83d5b05671beab59cd943539c378b46/src/.nuxt/dist/icons/icon_64.9qid3ZBUcQn.png -------------------------------------------------------------------------------- /src/.nuxt/dist/index.spa.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{ HEAD }} 5 | 6 | 7 | {{ APP }} 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/.nuxt/dist/index.ssr.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{ HEAD }} 5 | 6 | 7 | {{ APP }} 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/.nuxt/dist/manifest.18c4f7f1.json: -------------------------------------------------------------------------------- 1 | {"name":"nuxt-ssr-firebase-source","short_name":"nuxt-ssr-firebase-source","description":"> Nuxt.js project","publicPath":"//assets/","icons":[{"src":"/assets/icons/icon_64.9qid3ZBUcQn.png","sizes":"64x64","type":"image/png"},{"src":"/assets/icons/icon_120.9qid3ZBUcQn.png","sizes":"120x120","type":"image/png"},{"src":"/assets/icons/icon_144.9qid3ZBUcQn.png","sizes":"144x144","type":"image/png"},{"src":"/assets/icons/icon_152.9qid3ZBUcQn.png","sizes":"152x152","type":"image/png"},{"src":"/assets/icons/icon_192.9qid3ZBUcQn.png","sizes":"192x192","type":"image/png"},{"src":"/assets/icons/icon_384.9qid3ZBUcQn.png","sizes":"384x384","type":"image/png"},{"src":"/assets/icons/icon_512.9qid3ZBUcQn.png","sizes":"512x512","type":"image/png"}],"start_url":"/?standalone=true","display":"standalone","background_color":"#ffffff","theme_color":"#3B8070","lang":"en"} -------------------------------------------------------------------------------- /src/.nuxt/dist/vue-ssr-client-manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "publicPath": "/assets/", 3 | "all": [ 4 | "icons/icon_144.9qid3ZBUcQn.png", 5 | "2aa56ac0bcbbc141d9ca.js", 6 | "a95365ffe4047e6094dd.js", 7 | "c79fef71b97fb2a1e26e.js", 8 | "d97ee76b6641d6111716.js", 9 | "LICENSES", 10 | "icons/icon_64.9qid3ZBUcQn.png", 11 | "icons/icon_120.9qid3ZBUcQn.png", 12 | "6f77ffcd15ddb20c4434.js", 13 | "icons/icon_152.9qid3ZBUcQn.png", 14 | "icons/icon_192.9qid3ZBUcQn.png", 15 | "icons/icon_384.9qid3ZBUcQn.png", 16 | "icons/icon_512.9qid3ZBUcQn.png", 17 | "manifest.18c4f7f1.json", 18 | "index.ssr.html", 19 | "index.spa.html" 20 | ], 21 | "initial": [ 22 | "c79fef71b97fb2a1e26e.js", 23 | "d97ee76b6641d6111716.js" 24 | ], 25 | "async": [ 26 | "2aa56ac0bcbbc141d9ca.js", 27 | "a95365ffe4047e6094dd.js", 28 | "6f77ffcd15ddb20c4434.js" 29 | ], 30 | "modules": { 31 | "14502198": [ 32 | 3 33 | ], 34 | "54501242": [ 35 | 3 36 | ], 37 | "0f90a4c8": [ 38 | 3 39 | ], 40 | "5001d4bc": [ 41 | 3 42 | ], 43 | "06501d7c": [ 44 | 3 45 | ], 46 | "155f3b8a": [ 47 | 3 48 | ], 49 | "5b2c5af7": [ 50 | 3 51 | ], 52 | "63a080d5": [ 53 | 3 54 | ], 55 | "3642b0c9": [ 56 | 3 57 | ], 58 | "2eea921d": [ 59 | 3 60 | ], 61 | "5b351356": [ 62 | 3 63 | ], 64 | "51865a20": [ 65 | 3 66 | ], 67 | "70d7c10c": [ 68 | 3 69 | ], 70 | "5d3a0546": [ 71 | 3 72 | ], 73 | "2aaa1a58": [ 74 | 3 75 | ], 76 | "497ae47a": [ 77 | 3 78 | ], 79 | "0f2bc1dc": [ 80 | 3 81 | ], 82 | "1a65a490": [ 83 | 3 84 | ], 85 | "2bea819a": [ 86 | 3 87 | ], 88 | "29040fda": [ 89 | 3 90 | ], 91 | "05090404": [ 92 | 4 93 | ], 94 | "53aff1e4": [ 95 | 4 96 | ], 97 | "60f776b8": [ 98 | 3 99 | ], 100 | "0e249e42": [ 101 | 3 102 | ], 103 | "eef0f7a0": [ 104 | 3 105 | ], 106 | "55b953d8": [ 107 | 3 108 | ], 109 | "41b2099a": [ 110 | 3 111 | ], 112 | "d297055c": [ 113 | 3 114 | ], 115 | "752d63af": [ 116 | 3 117 | ], 118 | "1b6b1c39": [ 119 | 3 120 | ], 121 | "3f1f713c": [ 122 | 3 123 | ], 124 | "439147a2": [ 125 | 3 126 | ], 127 | "6013cf04": [ 128 | 3 129 | ], 130 | "fd81a62a": [ 131 | 3 132 | ], 133 | "b31fdc94": [ 134 | 3 135 | ], 136 | "4200adcd": [ 137 | 3 138 | ], 139 | "002dbb92": [ 140 | 4 141 | ], 142 | "6d7cd40e": [ 143 | 4 144 | ], 145 | "7279b843": [ 146 | 4 147 | ], 148 | "35a39c51": [ 149 | 4 150 | ], 151 | "6bbe092b": [ 152 | 4 153 | ], 154 | "e1f4c75c": [ 155 | 3 156 | ], 157 | "c0fe4470": [ 158 | 3 159 | ], 160 | "ec7efc7a": [ 161 | 3 162 | ], 163 | "58a59a0a": [ 164 | 3 165 | ], 166 | "03caef9e": [ 167 | 3 168 | ], 169 | "6e278281": [ 170 | 3 171 | ], 172 | "22bbc43d": [ 173 | 3 174 | ], 175 | "0d0d21ba": [ 176 | 3 177 | ], 178 | "359f450a": [ 179 | 3 180 | ], 181 | "34703a16": [ 182 | 3 183 | ], 184 | "167720ba": [ 185 | 3 186 | ], 187 | "72db6305": [ 188 | 3 189 | ], 190 | "5bbdd6b3": [ 191 | 3 192 | ], 193 | "00e8b82b": [ 194 | 3 195 | ], 196 | "f7ca66e4": [ 197 | 3 198 | ], 199 | "17ae2e58": [ 200 | 3 201 | ], 202 | "3cbcffa9": [ 203 | 4 204 | ], 205 | "78b12c1a": [ 206 | 3 207 | ], 208 | "183b1f1e": [ 209 | 3 210 | ], 211 | "49583c5a": [ 212 | 3 213 | ], 214 | "92b4e05a": [ 215 | 3 216 | ], 217 | "60c74a95": [ 218 | 3 219 | ], 220 | "cfbdd46a": [ 221 | 3 222 | ], 223 | "0703591b": [ 224 | 3 225 | ], 226 | "2d2ccf25": [ 227 | 3 228 | ], 229 | "2b986b4a": [ 230 | 3 231 | ], 232 | "58aa25c0": [ 233 | 3 234 | ], 235 | "06147eaf": [ 236 | 3 237 | ], 238 | "4c3c621c": [ 239 | 3 240 | ], 241 | "16f544ec": [ 242 | 3 243 | ], 244 | "2fb3fa5c": [ 245 | 3 246 | ], 247 | "22f9958a": [ 248 | 3 249 | ], 250 | "4e2dd768": [ 251 | 3 252 | ], 253 | "5be0fea3": [ 254 | 3 255 | ], 256 | "650cf044": [ 257 | 3 258 | ], 259 | "6cff402c": [ 260 | 3 261 | ], 262 | "7958b580": [ 263 | 3 264 | ], 265 | "5b8f7046": [ 266 | 4 267 | ], 268 | "2a1a843a": [ 269 | 4 270 | ], 271 | "03bfda1a": [ 272 | 4 273 | ], 274 | "f2b20742": [ 275 | 4 276 | ], 277 | "16c78423": [ 278 | 3 279 | ], 280 | "43731b61": [ 281 | 3 282 | ], 283 | "5baec0b5": [ 284 | 4 285 | ], 286 | "5b976c21": [ 287 | 4 288 | ], 289 | "4885e307": [ 290 | 4 291 | ], 292 | "7e9b7b1b": [ 293 | 4 294 | ], 295 | "0bafc715": [ 296 | 4 297 | ], 298 | "41c55f29": [ 299 | 4 300 | ], 301 | "c29616c6": [ 302 | 4 303 | ], 304 | "6139684e": [ 305 | 4 306 | ], 307 | "90088a32": [ 308 | 4 309 | ], 310 | "3a6df953": [ 311 | 4 312 | ], 313 | "63e0c584": [ 314 | 4 315 | ], 316 | "3327ba76": [ 317 | 4 318 | ], 319 | "4741edf6": [ 320 | 3 321 | ], 322 | "06d92d05": [ 323 | 3 324 | ], 325 | "645a1497": [ 326 | 3 327 | ], 328 | "e0479b9a": [ 329 | 3 330 | ], 331 | "4d3cf23d": [ 332 | 3 333 | ], 334 | "c6091e14": [ 335 | 3 336 | ], 337 | "53dcccb7": [ 338 | 3 339 | ], 340 | "6503bd21": [ 341 | 3 342 | ], 343 | "a56ebff6": [ 344 | 3 345 | ], 346 | "43d23f26": [ 347 | 3 348 | ], 349 | "3ed0803c": [ 350 | 3 351 | ], 352 | "2ff8cc20": [ 353 | 3 354 | ], 355 | "869faff4": [ 356 | 3 357 | ], 358 | "477fb31e": [ 359 | 3 360 | ], 361 | "78f87678": [ 362 | 3 363 | ], 364 | "a5803654": [ 365 | 3 366 | ], 367 | "12791b0e": [ 368 | 3 369 | ], 370 | "423c9a5c": [ 371 | 3 372 | ], 373 | "a026283a": [ 374 | 3 375 | ], 376 | "15fb62f8": [ 377 | 3 378 | ], 379 | "74670ad2": [ 380 | 3 381 | ], 382 | "47f70eaa": [ 383 | 3 384 | ], 385 | "470823fc": [ 386 | 3 387 | ], 388 | "41a4e7b6": [ 389 | 3 390 | ], 391 | "802a7a7e": [ 392 | 3 393 | ], 394 | "438fda3f": [ 395 | 3 396 | ], 397 | "bf241c02": [ 398 | 3 399 | ], 400 | "622a3f64": [ 401 | 3 402 | ], 403 | "2608ae2e": [ 404 | 3 405 | ], 406 | "24f31105": [ 407 | 3 408 | ], 409 | "7d13e3a9": [ 410 | 3 411 | ], 412 | "58b33d2c": [ 413 | 3 414 | ], 415 | "81865d68": [ 416 | 3 417 | ], 418 | "0822b904": [ 419 | 3 420 | ], 421 | "31c88054": [ 422 | 3 423 | ], 424 | "154ecbd6": [ 425 | 3 426 | ], 427 | "d2841012": [ 428 | 3 429 | ], 430 | "7637e8af": [ 431 | 3 432 | ], 433 | "2e59b793": [ 434 | 3 435 | ], 436 | "cca0889e": [ 437 | 3 438 | ], 439 | "15e47d68": [ 440 | 3 441 | ], 442 | "302b03e2": [ 443 | 3 444 | ], 445 | "691f6574": [ 446 | 3 447 | ], 448 | "2323c05b": [ 449 | 3 450 | ], 451 | "2b0e4b81": [ 452 | 3 453 | ], 454 | "5601553a": [ 455 | 3 456 | ], 457 | "18a001c5": [ 458 | 3 459 | ], 460 | "7fa5a5bf": [ 461 | 3 462 | ], 463 | "2a91d752": [ 464 | 3 465 | ], 466 | "aae6143c": [ 467 | 1 468 | ], 469 | "3cfa209e": [ 470 | 1 471 | ], 472 | "3ce2cc0a": [ 473 | 1 474 | ], 475 | "10a2f4fa": [ 476 | 8 477 | ], 478 | "1086c5f8": [ 479 | 2 480 | ], 481 | "d533015c": [ 482 | 1 483 | ] 484 | } 485 | } -------------------------------------------------------------------------------- /src/.nuxt/dist/workbox.3de3418b.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2016 Google Inc. All Rights Reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | */ 15 | 16 | var WorkboxSW = (function () { 17 | 'use strict'; 18 | 19 | class ErrorFactory$1{constructor(a){this._errors=a;}createError(a,b){if(!(a in this._errors))throw new Error(`Unable to generate error '${a}'.`);let c=this._errors[a].replace(/\s+/g,' '),d=null;b&&(c+=` [${b.message}]`,d=b.stack);const e=new Error;return e.name=a,e.message=c,e.stack=d,e}} 20 | 21 | const errors={"not-in-sw":'workbox-sw must be loaded in your service worker file.',"unsupported-route-type":'The first parameter to registerRoute() should be either an Express-style path string, a RegExp, or a function.',"empty-express-string":'The Express style route string must have some characters, an empty string is invalid.',"bad-revisioned-cache-list":`The 'precache()' method expects`+`an array of revisioned urls like so: ['/example/hello.1234.txt', `+`{path: 'hello.txt', revision: '1234'}]`,"navigation-route-url-string":`The registerNavigationRoute() method `+`expects a URL string as its first parameter.`,"bad-cache-id":`The 'cacheId' parameter must be a string with at least `+`one character`,"bad-skip-waiting":`The 'skipWaiting' parameter must be a boolean.`,"bad-clients-claim":`The 'clientsClaim' parameter must be a boolean.`,"bad-directory-index":`The 'directoryIndex' parameter must be a boolean.`};var ErrorFactory = new ErrorFactory$1(errors); 22 | 23 | class LogGroup{constructor(){this._logs=[],this._childGroups=[],this._isFallbackMode=!1;const a=/Firefox\/(\d*)\.\d*/.exec(navigator.userAgent);if(a)try{const b=parseInt(a[1],10);55>b&&(this._isFallbackMode=!0);}catch(a){this._isFallbackMode=!0;}/Edge\/\d*\.\d*/.exec(navigator.userAgent)&&(this._isFallbackMode=!0);}addPrimaryLog(a){this._primaryLog=a;}addLog(a){this._logs.push(a);}addChildGroup(a){0===a._logs.length||this._childGroups.push(a);}print(){return 0===this._logs.length&&0===this._childGroups.length?void this._printLogDetails(this._primaryLog):void(this._primaryLog&&(this._isFallbackMode?this._printLogDetails(this._primaryLog):console.groupCollapsed(...this._getLogContent(this._primaryLog))),this._logs.forEach((a)=>{this._printLogDetails(a);}),this._childGroups.forEach((a)=>{a.print();}),this._primaryLog&&!this._isFallbackMode&&console.groupEnd())}_printLogDetails(a){const b=a.logFunc?a.logFunc:console.log;b(...this._getLogContent(a));}_getLogContent(a){let b=a.message;this._isFallbackMode&&'string'==typeof b&&(b=b.replace(/%c/g,''));let c=[b];return!this._isFallbackMode&&a.colors&&(c=c.concat(a.colors)),a.args&&(c=c.concat(a.args)),c}} 24 | 25 | function isServiceWorkerGlobalScope(){return'ServiceWorkerGlobalScope'in self&&self instanceof ServiceWorkerGlobalScope}function isDevBuild(){return`dev`==`prod`}function isLocalhost(){return!!('localhost'===location.hostname||'[::1]'===location.hostname||location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/))} 26 | 27 | self.workbox=self.workbox||{},self.workbox.LOG_LEVEL=self.workbox.LOG_LEVEL||{none:-1,verbose:0,debug:1,warn:2,error:3};const LIGHT_GREY=`#bdc3c7`; const DARK_GREY=`#7f8c8d`; const LIGHT_GREEN=`#2ecc71`; const LIGHT_YELLOW=`#f1c40f`; const LIGHT_RED=`#e74c3c`; const LIGHT_BLUE=`#3498db`;class LogHelper{constructor(){this._defaultLogLevel=isDevBuild()?self.workbox.LOG_LEVEL.debug:self.workbox.LOG_LEVEL.warn;}log(a){this._printMessage(self.workbox.LOG_LEVEL.verbose,a);}debug(a){this._printMessage(self.workbox.LOG_LEVEL.debug,a);}warn(a){this._printMessage(self.workbox.LOG_LEVEL.warn,a);}error(a){this._printMessage(self.workbox.LOG_LEVEL.error,a);}_printMessage(a,b){if(this._shouldLogMessage(a,b)){const c=this._getAllLogGroups(a,b);c.print();}}_getAllLogGroups(a,b){const c=new LogGroup,d=this._getPrimaryMessageDetails(a,b);if(c.addPrimaryLog(d),b.error){const a={message:b.error,logFunc:console.error};c.addLog(a);}const e=new LogGroup;if(b.that&&b.that.constructor&&b.that.constructor.name){const a=b.that.constructor.name;e.addLog(this._getKeyValueDetails('class',a));}return b.data&&('object'!=typeof b.data||b.data instanceof Array?e.addLog(this._getKeyValueDetails('additionalData',b.data)):Object.keys(b.data).forEach((a)=>{e.addLog(this._getKeyValueDetails(a,b.data[a]));})),c.addChildGroup(e),c}_getKeyValueDetails(a,b){return{message:`%c${a}: `,colors:[`color: ${LIGHT_BLUE}`],args:b}}_getPrimaryMessageDetails(a,b){let c,d;a===self.workbox.LOG_LEVEL.verbose?(c='Info',d=LIGHT_GREY):a===self.workbox.LOG_LEVEL.debug?(c='Debug',d=LIGHT_GREEN):a===self.workbox.LOG_LEVEL.warn?(c='Warn',d=LIGHT_YELLOW):a===self.workbox.LOG_LEVEL.error?(c='Error',d=LIGHT_RED):void 0;let e=`%c🔧 %c[${c}]`;const f=[`color: ${LIGHT_GREY}`,`color: ${d}`];let g;return'string'==typeof b?g=b:b.message&&(g=b.message),g&&(g=g.replace(/\s+/g,' '),e+=`%c ${g}`,f.push(`color: ${DARK_GREY}; font-weight: normal`)),{message:e,colors:f}}_shouldLogMessage(a,b){if(!b)return!1;let c=this._defaultLogLevel;return self&&self.workbox&&'number'==typeof self.workbox.logLevel&&(c=self.workbox.logLevel),c===self.workbox.LOG_LEVEL.none||a[]}; 34 | 35 | function atLeastOne(a){const b=Object.keys(a);b.some((b)=>a[b]!==void 0)||throwError('Please set at least one of the following parameters: '+b.map((a)=>`'${a}'`).join(', '));}function hasMethod(a,b){const c=Object.keys(a).pop(),d=typeof a[c][b];'function'!=d&&throwError(`The '${c}' parameter must be an object that exposes a 36 | '${b}' method.`);}function isInstance(a,b){const c=Object.keys(a).pop();a[c]instanceof b||throwError(`The '${c}' parameter must be an instance of 37 | '${b.name}'`);}function isOneOf(a,b){const c=Object.keys(a).pop();b.includes(a[c])||throwError(`The '${c}' parameter must be set to one of the 38 | following: ${b}`);}function isType(a,b){const c=Object.keys(a).pop(),d=typeof a[c];d!==b&&throwError(`The '${c}' parameter has the wrong type. (Expected: 39 | ${b}, actual: ${d})`);}function isArrayOfType(a,b){const c=Object.keys(a).pop(),d=`The '${c}' parameter should be an array containing 40 | one or more '${b}' elements.`;Array.isArray(a[c])||throwError(d);for(let e of a[c])typeof e!==b&&throwError(d);}function isArrayOfClass(a,b){const c=Object.keys(a).pop(),d=`The '${c}' parameter should be an array containing 41 | one or more '${b.name}' instances.`;Array.isArray(a[c])||throwError(d);for(let e of a[c])e instanceof b||throwError(d);}function throwError(a){a=a.replace(/\s+/g,' ');const b=new Error(a);b.name='assertion-failed';const c=ErrorStackParser.parse(b);throw 3<=c.length&&(b.message=`Invalid call to ${c[2].functionName}() — `+a),b} 42 | 43 | function normalizeHandler(a){return'object'==typeof a?(hasMethod({handler:a},'handle'),a):(isType({handler:a},'function'),{handle:a})} 44 | 45 | const defaultMethod='GET';const validMethods=['DELETE','GET','HEAD','POST','PUT']; 46 | 47 | class Route{constructor({match:a,handler:b,method:c}={}){this.handler=normalizeHandler(b),isType({match:a},'function'),this.match=a,c?(isOneOf({method:c},validMethods),this.method=c):this.method=defaultMethod;}} 48 | 49 | var index$1=Array.isArray||function(a){return'[object Array]'==Object.prototype.toString.call(a)}; 50 | 51 | var index=pathToRegexp; var parse_1=parse; var compile_1=compile; var tokensToFunction_1=tokensToFunction; var tokensToRegExp_1=tokensToRegExp; var PATH_REGEXP=new RegExp('(\\\\.)|([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))','g');function parse(a,b){for(var c,d=[],e=0,f=0,g='',h=b&&b.delimiter||'/';null!=(c=PATH_REGEXP.exec(a));){var i=c[0],j=c[1],k=c.index;if(g+=a.slice(f,k),f=k+i.length,j){g+=j[1];continue}var l=a[f],m=c[2],n=c[3],o=c[4],p=c[5],q=c[6],r=c[7];g&&(d.push(g),g='');var s=c[2]||h,t=o||p;d.push({name:n||e++,prefix:m||'',delimiter:s,optional:'?'===q||'*'===q,repeat:'+'===q||'*'===q,partial:null!=m&&null!=l&&l!==m,asterisk:!!r,pattern:t?escapeGroup(t):r?'.*':'[^'+escapeString(s)+']+?'});}return f{if(a.startsWith('/')&&b.origin!==location.origin)return null;const c=a.startsWith('/')?b.pathname:b.href,f=c.match(e);if(!f)return null;const g={};return d.forEach((a,b)=>{g[a.name]=f[b+1];}),g},handler:b,method:c});}} 54 | 55 | class NavigationRoute extends Route{constructor({whitelist:a,blacklist:b,handler:c}={}){isArrayOfClass({whitelist:a},RegExp),b?isArrayOfClass({blacklist:b},RegExp):b=[];super({match:({event:d,url:e})=>{let f,g=!1;if('navigate'===d.request.mode){const d=e.pathname+e.search;a.some((a)=>a.test(d))?b.some((a)=>a.test(d))?f=`The navigation route is not being used, since the `+`request URL matches both the whitelist and blacklist.`:(f=`The navigation route is being used.`,g=!0):f=`The navigation route is not being used, since the `+`URL being navigated to doesn't match the whitelist.`,logHelper.debug({that:this,message:f,data:{"request-url":e.href,whitelist:a,blacklist:b,handler:c}});}return g},handler:c,method:'GET'});}} 56 | 57 | class RegExpRoute extends Route{constructor({regExp:a,handler:b,method:c}){isInstance({regExp:a},RegExp);super({match:({url:b})=>{const c=a.exec(b.href);return c?b.origin!==location.origin&&0!==c.index?(logHelper.debug({that:this,message:`Skipping route, because the RegExp match didn't occur `+`at the start of the URL.`,data:{url:b.href,regExp:a}}),null):c.slice(1):null},handler:b,method:c});}} 58 | 59 | class Router$2{constructor(){this._routes=new Map,this._isListenerRegistered=!1;}addFetchListener(){return this._isListenerRegistered?(logHelper.warn({that:this,message:`addFetchListener() has already been called for this Router.`}),!1):(this._isListenerRegistered=!0,self.addEventListener('fetch',(a)=>{const b=this.handleRequest({event:a});b&&a.respondWith(b);}),!0)}handleRequest({event:a}){isInstance({event:a},FetchEvent);const b=new URL(a.request.url);if(!b.protocol.startsWith('http'))return void logHelper.log({that:this,message:`The URL does not start with HTTP, so it can't be handled.`,data:{request:a.request}});let{handler:c,params:d}=this._findHandlerAndParams({event:a,url:b});if(!c&&this.defaultHandler&&(c=this.defaultHandler),c){let e=c.handle({url:b,event:a,params:d});return this.catchHandler&&(e=e.catch((c)=>this.catchHandler.handle({url:b,event:a,error:c}))),e}}_findHandlerAndParams({event:a,url:b}){const c=this._routes.get(a.request.method)||[];for(const d of c){let c=d.match({url:b,event:a});if(c)return logHelper.log({that:this,message:'The router found a matching route.',data:{route:d,request:a.request}}),Array.isArray(c)&&0===c.length?c=void 0:c.constructor===Object&&0===Object.keys(c).length&&(c=void 0),{params:c,handler:d.handler}}return{handler:void 0,params:void 0}}setDefaultHandler({handler:a}={}){this.defaultHandler=normalizeHandler(a);}setCatchHandler({handler:a}={}){this.catchHandler=normalizeHandler(a);}registerRoutes({routes:a}={}){isArrayOfClass({routes:a},Route);for(let b of a)this._routes.has(b.method)||this._routes.set(b.method,[]),this._routes.get(b.method).unshift(b);}registerRoute({route:a}={}){isInstance({route:a},Route),this.registerRoutes({routes:[a]});}unregisterRoutes({routes:a}={}){isArrayOfClass({routes:a},Route);for(let b of a){this._routes.has(b.method)||logHelper.error({that:this,message:`Can't unregister route; there are no ${b.method} 60 | routes registered.`,data:{route:b}});const a=this._routes.get(b.method).indexOf(b);-1caches.match(a,{cacheName:c}),whitelist:b.whitelist||[/./],blacklist:b.blacklist||[]})});}} 64 | 65 | const errors$2={"multiple-cache-will-update-plugins":'You cannot register more than one plugin that implements cacheWillUpdate.',"multiple-cached-response-will-be-used-plugins":'You cannot register more than one plugin that implements cachedResponseWillBeUsed.',"invalid-response-for-caching":'The fetched response could not be cached due to an invalid response code.',"no-response-received":'No response received; falling back to cache.',"bad-cache-id":`The 'cacheId' parameter must be a string with at least `+`one character.`};var ErrorFactory$4 = new ErrorFactory$1(errors$2); 66 | 67 | class CacheableResponse{constructor({statuses:a,headers:b}={}){atLeastOne({statuses:a,headers:b}),a!==void 0&&isArrayOfType({statuses:a},'number'),b!==void 0&&isType({headers:b},'object'),this.statuses=a,this.headers=b;}isResponseCacheable({request:a,response:b}={}){isInstance({response:b},Response);let c=!0;if(this.statuses&&(c=this.statuses.includes(b.status)),this.headers&&c&&(c=Object.keys(this.headers).some((a)=>b.headers.get(a)===this.headers[a])),!c){const c={response:b};this.statuses&&(c['valid-status-codes']=JSON.stringify(this.statuses)),this.headers&&(c['valid-headers']=JSON.stringify(this.headers)),a&&(c.request=a),logHelper.debug({message:`The response does not meet the criteria for being added to the 68 | cache.`,data:c});}return c}} 69 | 70 | class CacheableResponsePlugin extends CacheableResponse{cacheWillUpdate({request:a,response:b}={}){return this.isResponseCacheable({request:a,response:b})}} 71 | 72 | const getDefaultCacheName=({cacheId:a}={})=>{let b=`workbox-runtime-caching`;return a&&(b=`${a}-${b}`),self&&self.registration&&(b+=`-${self.registration.scope}`),b}; 73 | const pluginCallbacks=['cacheDidUpdate','cachedResponseWillBeUsed','cacheWillUpdate','fetchDidFail','requestWillFetch']; 74 | 75 | var cleanResponseCopy = (({response:a})=>{isInstance({response:a},Response);const b=a.clone(),c='body'in b?Promise.resolve(b.body):b.blob();return c.then((a)=>new Response(a,{headers:b.headers,status:b.status,statusText:b.statusText}))}); 76 | 77 | var asyncToGenerator = function (fn) { 78 | return function () { 79 | var gen = fn.apply(this, arguments); 80 | return new Promise(function (resolve, reject) { 81 | function step(key, arg) { 82 | try { 83 | var info = gen[key](arg); 84 | var value = info.value; 85 | } catch (error) { 86 | reject(error); 87 | return; 88 | } 89 | 90 | if (info.done) { 91 | resolve(value); 92 | } else { 93 | return Promise.resolve(value).then(function (value) { 94 | step("next", value); 95 | }, function (err) { 96 | step("throw", err); 97 | }); 98 | } 99 | } 100 | 101 | return step("next"); 102 | }); 103 | }; 104 | }; 105 | 106 | class RequestWrapper{constructor({cacheName:a,cacheId:b,plugins:c,fetchOptions:d,matchOptions:e}={}){if(b&&('string'!=typeof b||0===b.length))throw ErrorFactory$4.createError('bad-cache-id');a?(isType({cacheName:a},'string'),this.cacheName=a,b&&(this.cacheName=`${b}-${this.cacheName}`)):this.cacheName=getDefaultCacheName({cacheId:b}),d&&(isType({fetchOptions:d},'object'),this.fetchOptions=d),e&&(isType({matchOptions:e},'object'),this.matchOptions=e),this.plugins=new Map,c&&(isArrayOfType({plugins:c},'object'),c.forEach((a)=>{for(let b of pluginCallbacks)if('function'==typeof a[b]){if(!this.plugins.has(b))this.plugins.set(b,[]);else if('cacheWillUpdate'===b)throw ErrorFactory$4.createError('multiple-cache-will-update-plugins');else if('cachedResponseWillBeUsed'===b)throw ErrorFactory$4.createError('multiple-cached-response-will-be-used-plugins');this.plugins.get(b).push(a);}})),this.plugins.has('cacheWillUpdate')&&(this._userSpecifiedCachableResponsePlugin=this.plugins.get('cacheWillUpdate')[0]);}getDefaultCacheableResponsePlugin(){return this._defaultCacheableResponsePlugin||(this._defaultCacheableResponsePlugin=new CacheableResponsePlugin({statuses:[200]})),this._defaultCacheableResponsePlugin}getCache(){var a=this;return asyncToGenerator(function*(){return a._cache||(a._cache=yield caches.open(a.cacheName)),a._cache})()}match({request:a}){var b=this;return asyncToGenerator(function*(){atLeastOne({request:a});const c=yield b.getCache();let d=yield c.match(a,b.matchOptions);if(b.plugins.has('cachedResponseWillBeUsed')){const e=b.plugins.get('cachedResponseWillBeUsed')[0];d=yield e.cachedResponseWillBeUsed({request:a,cache:c,cachedResponse:d,matchOptions:b.matchOptions,cacheName:b.cacheName});}return d})()}fetch({request:a}){var b=this;return asyncToGenerator(function*(){'string'==typeof a?a=new Request(a):isInstance({request:a},Request);const c=b.plugins.has('fetchDidFail')?a.clone():null;if(b.plugins.has('requestWillFetch'))for(let c of b.plugins.get('requestWillFetch')){const b=yield c.requestWillFetch({request:a});isInstance({returnedRequest:b},Request),a=b;}try{return yield fetch(a,b.fetchOptions)}catch(a){if(b.plugins.has('fetchDidFail'))for(let a of b.plugins.get('fetchDidFail'))yield a.fetchDidFail({request:c.clone()});throw a}})()}fetchAndCache({request:a,waitOnCache:b,cacheKey:c,cacheResponsePlugin:d,cleanRedirects:e}){var f=this;return asyncToGenerator(function*(){atLeastOne({request:a});let g;const h=yield f.fetch({request:a}),i=f._userSpecifiedCachableResponsePlugin||d||f.getDefaultCacheableResponsePlugin(),j=yield i.cacheWillUpdate({request:a,response:h});if(j){const b=e&&h.redirected?yield cleanResponseCopy({response:h}):h.clone();g=f.getCache().then((()=>{var d=asyncToGenerator(function*(d){let e;const g=c||a;if('opaque'!==h.type&&f.plugins.has('cacheDidUpdate')&&(e=yield f.match({request:g})),yield d.put(g,b),f.plugins.has('cacheDidUpdate'))for(let a of f.plugins.get('cacheDidUpdate'))yield a.cacheDidUpdate({cacheName:f.cacheName,oldResponse:e,newResponse:b,url:'url'in g?g.url:g});});return function(){return d.apply(this,arguments)}})());}else if(!j&&b)throw ErrorFactory$4.createError('invalid-response-for-caching');return b&&g&&(yield g),h})()}} 107 | 108 | class Handler{constructor({requestWrapper:a,waitOnCache:b}={}){this.requestWrapper=a?a:new RequestWrapper,this.waitOnCache=!!b;}handle({event:a,params:b}={}){throw Error('This abstract method must be implemented in a subclass.')}} 109 | 110 | class CacheFirst extends Handler{handle({event:a}={}){var b=this;return asyncToGenerator(function*(){isInstance({event:a},FetchEvent);const c=yield b.requestWrapper.match({request:a.request});return c||(yield b.requestWrapper.fetchAndCache({request:a.request,waitOnCache:b.waitOnCache}))})()}} 111 | 112 | class CacheOnly extends Handler{handle({event:a}={}){var b=this;return asyncToGenerator(function*(){return isInstance({event:a},FetchEvent),yield b.requestWrapper.match({request:a.request})})()}} 113 | 114 | class NetworkFirst extends Handler{constructor(a={}){super(a),this._cacheablePlugin=new CacheableResponsePlugin({statuses:[0,200]});const{networkTimeoutSeconds:b}=a;b&&(isType({networkTimeoutSeconds:b},'number'),this.networkTimeoutSeconds=b);}handle({event:a}={}){var b=this;return asyncToGenerator(function*(){isInstance({event:a},FetchEvent);const c=[];let d;b.networkTimeoutSeconds&&c.push(new Promise(function(c){d=setTimeout(function(){c(b.requestWrapper.match({request:a.request}));},1e3*b.networkTimeoutSeconds);}));const e=b.requestWrapper.fetchAndCache({request:a.request,waitOnCache:b.waitOnCache,cacheResponsePlugin:b._cacheablePlugin}).then(function(a){return d&&clearTimeout(d),a?a:Promise.reject(ErrorFactory$4.createError('no-response-received'))}).catch(function(){return b.requestWrapper.match({request:a.request})});return c.push(e),Promise.race(c)})()}} 115 | 116 | class NetworkOnly extends Handler{handle({event:a}={}){var b=this;return asyncToGenerator(function*(){return isInstance({event:a},FetchEvent),yield b.requestWrapper.fetch({request:a.request})})()}} 117 | 118 | class StaleWhileRevalidate extends Handler{constructor(a={}){super(a),this._cacheablePlugin=new CacheableResponsePlugin({statuses:[0,200]});}handle({event:a}={}){var b=this;return asyncToGenerator(function*(){isInstance({event:a},FetchEvent);const c=b.requestWrapper.fetchAndCache({request:a.request,waitOnCache:b.waitOnCache,cacheResponsePlugin:b._cacheablePlugin}).catch(function(){return Response.error()}),d=yield b.requestWrapper.match({request:a.request});return d||(yield c)})()}} 119 | 120 | let tmpIdbName=`workbox-cache-expiration`;self&&self.registration&&(tmpIdbName+=`-${self.registration.scope}`);const idbName=tmpIdbName;const idbVersion=1;const urlPropertyName='url';const timestampPropertyName='timestamp'; 121 | 122 | function createCommonjsModule(fn, module) { 123 | return module = { exports: {} }, fn(module, module.exports), module.exports; 124 | } 125 | 126 | var idb=createCommonjsModule(function(a){'use strict';(function(){function b(a){return Array.prototype.slice.call(a)}function c(a){return new Promise(function(b,c){a.onsuccess=function(){b(a.result);},a.onerror=function(){c(a.error);};})}function d(a,b,d){var e,f=new Promise(function(f,g){e=a[b].apply(a,d),c(e).then(f,g);});return f.request=e,f}function e(a,b,c){var e=d(a,b,c);return e.then(function(a){return a?new k(a,e.request):void 0})}function f(a,b,c){c.forEach(function(c){Object.defineProperty(a.prototype,c,{get:function(){return this[b][c]},set:function(a){this[b][c]=a;}});});}function g(a,b,c,e){e.forEach(function(e){e in c.prototype&&(a.prototype[e]=function(){return d(this[b],e,arguments)});});}function h(a,b,c,d){d.forEach(function(d){d in c.prototype&&(a.prototype[d]=function(){return this[b][d].apply(this[b],arguments)});});}function i(a,b,c,d){d.forEach(function(d){d in c.prototype&&(a.prototype[d]=function(){return e(this[b],d,arguments)});});}function j(a){this._index=a;}function k(a,b){this._cursor=a,this._request=b;}function l(a){this._store=a;}function m(a){this._tx=a,this.complete=new Promise(function(b,c){a.oncomplete=function(){b();},a.onerror=function(){c(a.error);},a.onabort=function(){c(a.error);};});}function n(a,b,c){this._db=a,this.oldVersion=b,this.transaction=new m(c);}function o(a){this._db=a;}f(j,'_index',['name','keyPath','multiEntry','unique']),g(j,'_index',IDBIndex,['get','getKey','getAll','getAllKeys','count']),i(j,'_index',IDBIndex,['openCursor','openKeyCursor']),f(k,'_cursor',['direction','key','primaryKey','value']),g(k,'_cursor',IDBCursor,['update','delete']),['advance','continue','continuePrimaryKey'].forEach(function(a){a in IDBCursor.prototype&&(k.prototype[a]=function(){var b=this,d=arguments;return Promise.resolve().then(function(){return b._cursor[a].apply(b._cursor,d),c(b._request).then(function(a){return a?new k(a,b._request):void 0})})});}),l.prototype.createIndex=function(){return new j(this._store.createIndex.apply(this._store,arguments))},l.prototype.index=function(){return new j(this._store.index.apply(this._store,arguments))},f(l,'_store',['name','keyPath','indexNames','autoIncrement']),g(l,'_store',IDBObjectStore,['put','add','delete','clear','get','getAll','getKey','getAllKeys','count']),i(l,'_store',IDBObjectStore,['openCursor','openKeyCursor']),h(l,'_store',IDBObjectStore,['deleteIndex']),m.prototype.objectStore=function(){return new l(this._tx.objectStore.apply(this._tx,arguments))},f(m,'_tx',['objectStoreNames','mode']),h(m,'_tx',IDBTransaction,['abort']),n.prototype.createObjectStore=function(){return new l(this._db.createObjectStore.apply(this._db,arguments))},f(n,'_db',['name','version','objectStoreNames']),h(n,'_db',IDBDatabase,['deleteObjectStore','close']),o.prototype.transaction=function(){return new m(this._db.transaction.apply(this._db,arguments))},f(o,'_db',['name','version','objectStoreNames']),h(o,'_db',IDBDatabase,['close']),['openCursor','openKeyCursor'].forEach(function(a){[l,j].forEach(function(c){c.prototype[a.replace('open','iterate')]=function(){var c=b(arguments),d=c[c.length-1],e=this._store||this._index,f=e[a].apply(e,c.slice(0,-1));f.onsuccess=function(){d(f.result);};};});}),[j,l].forEach(function(a){a.prototype.getAll||(a.prototype.getAll=function(a,b){var c=this,d=[];return new Promise(function(e){c.iterateCursor(a,function(a){return a?(d.push(a.value),void 0!==b&&d.length==b?void e(d):void a.continue()):void e(d)});})});});var p={open:function(a,b,c){var e=d(indexedDB,'open',[a,b]),f=e.request;return f.onupgradeneeded=function(a){c&&c(new n(f.result,a.oldVersion,f.transaction));},e.then(function(a){return new o(a)})},delete:function(a){return d(indexedDB,'deleteDatabase',[a])}};a.exports=p,a.exports.default=a.exports;})();}); 127 | 128 | const errors$3={"max-entries-or-age-required":`Either the maxEntries or maxAgeSeconds 129 | parameters (or both) are required when constructing Plugin.`,"max-entries-must-be-number":`The maxEntries parameter to the Plugin 130 | constructor must either be a number or undefined.`,"max-age-seconds-must-be-number":`The maxAgeSeconds parameter to the Plugin 131 | constructor must either be a number or undefined.`};var ErrorFactory$5 = new ErrorFactory$1(errors$3); 132 | 133 | class CacheExpiration{constructor({maxEntries:a,maxAgeSeconds:b}={}){if(!(a||b))throw ErrorFactory$5.createError('max-entries-or-age-required');if(a&&'number'!=typeof a)throw ErrorFactory$5.createError('max-entries-must-be-number');if(b&&'number'!=typeof b)throw ErrorFactory$5.createError('max-age-seconds-must-be-number');this.maxEntries=a,this.maxAgeSeconds=b,this._dbs=new Map,this._caches=new Map,this._expirationMutex=!1,this._timestampForNextRun=null;}getDB({cacheName:a}={}){var b=this;return asyncToGenerator(function*(){isType({cacheName:a},'string');const c=`${idbName}-${a}`;if(!b._dbs.has(c)){const d=yield idb.open(c,idbVersion,function(b){const c=b.createObjectStore(a,{keyPath:urlPropertyName});c.createIndex(timestampPropertyName,timestampPropertyName,{unique:!1});});b._dbs.set(c,d);}return b._dbs.get(c)})()}getCache({cacheName:a}={}){var b=this;return asyncToGenerator(function*(){if(isType({cacheName:a},'string'),!b._caches.has(a)){const c=yield caches.open(a);b._caches.set(a,c);}return b._caches.get(a)})()}isResponseFresh({cacheName:a,cachedResponse:b,now:c}={}){if(b&&this.maxAgeSeconds){isInstance({cachedResponse:b},Response);const d=b.headers.get('date');if(d){'undefined'==typeof c&&(c=Date.now());const a=new Date(d),b=a.getTime();return!!isNaN(b)||b+1e3*this.maxAgeSeconds>c}return this.expireEntries({cacheName:a,now:c}),!0}return!0}updateTimestamp({cacheName:a,url:b,now:c}={}){var d=this;return asyncToGenerator(function*(){isType({url:b},'string'),isType({cacheName:a},'string');const e=new URL(b,location);e.hash='','undefined'==typeof c&&(c=Date.now());const f=yield d.getDB({cacheName:a}),g=f.transaction(a,'readwrite');g.objectStore(a).put({[timestampPropertyName]:c,[urlPropertyName]:e.href}),yield g.complete;})()}expireEntries({cacheName:a,now:b}={}){var c=this;return asyncToGenerator(function*(){if(c._expirationMutex)return void(c._timestampForNextRun=b);c._expirationMutex=!0,isType({cacheName:a},'string'),'undefined'==typeof b&&(b=Date.now());const d=c.maxAgeSeconds?yield c.findOldEntries({cacheName:a,now:b}):[],e=c.maxEntries?yield c.findExtraEntries({cacheName:a}):[],f=[...new Set(d.concat(e))];if(yield c.deleteFromCacheAndIDB({cacheName:a,urls:f}),0b.maxEntries&&(e=d.transaction(a,'readonly'),f=e.objectStore(a),g=f.index(timestampPropertyName),g.iterateCursor(function(a){a&&(c.push(a.value[urlPropertyName]),h-c.length>b.maxEntries&&a.continue());})),yield e.complete,c})()}deleteFromCacheAndIDB({cacheName:a,urls:b}={}){var c=this;return asyncToGenerator(function*(){if(isType({cacheName:a},'string'),isArrayOfType({urls:b},'string'),0a.headers.has(c)&&b.headers.has(c));return d?c.every((c)=>a.headers.has(c)===b.headers.has(c)&&a.headers.get(c)===b.headers.get(c)):(logHelper.log({message:`Unable to determine whether the response has been updated 148 | because none of the headers that would be checked are present.`,data:{"First Response":a,"Second Response":b,"Headers To Check":JSON.stringify(c)}}),!0)} 149 | 150 | class BroadcastCacheUpdate{constructor({channelName:a,headersToCheck:b,source:c}={}){if('string'!=typeof a||0===a.length)throw ErrorFactory$6.createError('channel-name-required');this.channelName=a,this.headersToCheck=b||defaultHeadersToCheck,this.source=c||defaultSource;}get channel(){return this._channel||('BroadcastChannel'in self?this._channel=new BroadcastChannel(this.channelName):this._channel={postMessage:()=>{}}),this._channel}notifyIfUpdated({first:a,second:b,cacheName:c,url:d}){isType({cacheName:c},'string'),responsesAreSame({first:a,second:b,headersToCheck:this.headersToCheck})||broadcastUpdate({cacheName:c,url:d,channel:this.channel,source:this.source});}} 151 | 152 | class BroadcastCacheUpdatePlugin extends BroadcastCacheUpdate{cacheDidUpdate({cacheName:a,oldResponse:b,newResponse:c,url:d}){isType({cacheName:a},'string'),isInstance({newResponse:c},Response),b&&this.notifyIfUpdated({cacheName:a,first:b,second:c,url:d});}} 153 | 154 | class Strategies{constructor({cacheId:a}={}){this._cacheId=a;}cacheFirst(a){return this._getCachingMechanism(CacheFirst,a)}cacheOnly(a){return this._getCachingMechanism(CacheOnly,a)}networkFirst(a){return this._getCachingMechanism(NetworkFirst,a)}networkOnly(a){return this._getCachingMechanism(NetworkOnly,a)}staleWhileRevalidate(a){return this._getCachingMechanism(StaleWhileRevalidate,a)}_getCachingMechanism(a,b={}){const c={cacheExpiration:CacheExpirationPlugin,broadcastCacheUpdate:BroadcastCacheUpdatePlugin,cacheableResponse:CacheableResponsePlugin},d={plugins:[]};b.excludeCacheId||(d.cacheId=this._cacheId),b.cacheName&&(d.cacheName=b.cacheName);const e=Object.keys(c);return e.forEach((a)=>{if(b[a]){const e=c[a],f=b[a];d.plugins.push(new e(f));}}),b.plugins&&b.plugins.forEach((a)=>{d.plugins.push(a);}),b.requestWrapper=new RequestWrapper(d),new a(b)}} 155 | 156 | const errorMessageFactory=(a,b)=>{let c=`An error was thrown by workbox with error code: `+`;'${a}'`;return b&&(c+=` with extras: '${JSON.stringify(b)}'`),c}; 157 | 158 | class WorkboxError extends Error{constructor(a,b){super(),this.name=a,this.message=errorMessageFactory(a,b),b&&(this.extras=b);}} 159 | 160 | class BaseCacheManager{constructor({cacheName:a,cacheId:b,plugins:c}={}){if(b&&('string'!=typeof b||0===b.length))throw new WorkboxError('bad-cache-id',{cacheId:b});this._entriesToCache=new Map,this._requestWrapper=new RequestWrapper({cacheName:a,cacheId:b,plugins:c,fetchOptions:{credentials:'same-origin'}});}_addEntries(a){this._parsedCacheUrls=null,a.forEach((a)=>{this._addEntryToInstallList(this._parseEntry(a));});}getCacheName(){return this._requestWrapper.cacheName}getCachedUrls(){return this._parsedCacheUrls||(this._parsedCacheUrls=Array.from(this._entriesToCache.keys()).map((a)=>new URL(a,location).href)),this._parsedCacheUrls}_addEntryToInstallList(a){const b=a.entryID,c=this._entriesToCache.get(a.entryID);return c?void this._onDuplicateInstallEntryFound(a,c):void this._entriesToCache.set(b,a)}install(){var a=this;return asyncToGenerator(function*(){if(0===a._entriesToCache.size)return[];const b=[];return a._entriesToCache.forEach(function(c){b.push(a._cacheEntry(c));}),Promise.all(b)})()}_cacheEntry(a){var b=this;return asyncToGenerator(function*(){const c=yield b._isAlreadyCached(a),d={url:a.request.url,revision:a.revision,wasUpdated:!c};if(c)return d;try{return yield b._requestWrapper.fetchAndCache({request:a.getNetworkRequest(),waitOnCache:!0,cacheKey:a.request,cleanRedirects:!0}),yield b._onEntryCached(a),d}catch(b){throw new WorkboxError('request-not-cached',{url:a.request.url,error:b})}})()}cleanup(){var a=this;return asyncToGenerator(function*(){if(!(yield caches.has(a.getCacheName())))return;const b=[];a._entriesToCache.forEach(function(a){b.push(a.request.url);});const c=yield a._getCache(),d=yield c.keys(),e=d.filter(function(a){return!b.includes(a.url)});return Promise.all(e.map((()=>{var b=asyncToGenerator(function*(b){yield c.delete(b),yield a._onEntryDeleted(b.url);});return function(){return b.apply(this,arguments)}})()))})()}_getCache(){var a=this;return asyncToGenerator(function*(){return a._cache||(a._cache=yield caches.open(a.getCacheName())),a._cache})()}_parseEntry(){throw new WorkboxError('requires-overriding')}_onDuplicateEntryFound(){throw new WorkboxError('requires-overriding')}_isAlreadyCached(){throw new WorkboxError('requires-overriding')}_onEntryCached(){throw new WorkboxError('requires-overriding')}_onEntryDeleted(){throw new WorkboxError('requires-overriding')}} 161 | 162 | class IDBHelper{constructor(a,b,c){if(a==void 0||b==void 0||c==void 0)throw Error('name, version, storeName must be passed to the constructor.');this._name=a,this._version=b,this._storeName=c;}_getDb(){return this._dbPromise?this._dbPromise:(this._dbPromise=idb.open(this._name,this._version,(a)=>{a.createObjectStore(this._storeName);}).then((a)=>a),this._dbPromise)}close(){return this._dbPromise?this._dbPromise.then((a)=>{a.close(),this._dbPromise=null;}):void 0}put(a,b){return this._getDb().then((c)=>{const d=c.transaction(this._storeName,'readwrite'),e=d.objectStore(this._storeName);return e.put(b,a),d.complete})}delete(a){return this._getDb().then((b)=>{const c=b.transaction(this._storeName,'readwrite'),d=c.objectStore(this._storeName);return d.delete(a),c.complete})}get(a){return this._getDb().then((b)=>b.transaction(this._storeName).objectStore(this._storeName).get(a))}getAllValues(){return this._getDb().then((a)=>a.transaction(this._storeName).objectStore(this._storeName).getAll())}getAllKeys(){return this._getDb().then((a)=>a.transaction(this._storeName).objectStore(this._storeName).getAllKeys())}} 163 | 164 | const cacheBustParamName='_workbox-precaching';const version='v1';const dbName='workbox-precaching';const dbVersion='1';const dbStorename='asset-revisions';let tmpRevisionedCacheName=`workbox-precaching-revisioned-${version}`;self&&self.registration&&(tmpRevisionedCacheName+=`-${self.registration.scope}`);const defaultRevisionedCacheName=tmpRevisionedCacheName; 165 | 166 | class RevisionDetailsModel{constructor(){this._idbHelper=new IDBHelper(dbName,dbVersion,dbStorename);}get(a){return this._idbHelper.get(a)}put(a,b){return this._idbHelper.put(a,b)}delete(a){return this._idbHelper.delete(a)}_close(){this._idbHelper.close();}} 167 | 168 | class BaseCacheEntry{constructor({entryID:a,revision:b,request:c,cacheBust:d}){this.entryID=a,this.revision=b,this.request=c,this.cacheBust=d;}getNetworkRequest(){if(!0!==this.cacheBust)return this.request;let a=this.request.url;const b={};if(!0===this.cacheBust)if('cache'in Request.prototype)b.cache='reload';else{const b=new URL(a,location);b.search+=(b.search?'&':'')+encodeURIComponent(cacheBustParamName)+'='+encodeURIComponent(this.revision),a=b.toString();}return new Request(a,b)}} 169 | 170 | class StringCacheEntry extends BaseCacheEntry{constructor(a){if(isType({url:a},'string'),0===a.length)throw new WorkboxError('invalid-string-entry',{url:a});super({entryID:a,revision:a,request:new Request(a),cacheBust:!1});}} 171 | 172 | class ObjectCacheEntry extends BaseCacheEntry{constructor({entryID:a,revision:b,url:c,cacheBust:d}){if('undefined'!=typeof b&&(isType({revision:b},'string'),0===b.length))throw new WorkboxError('invalid-object-entry',{problemParam:'revision',problemValue:b});if('undefined'==typeof d&&(d=!!b),isType({cacheBust:d},'boolean'),isType({url:c},'string'),0===c.length)throw new WorkboxError('invalid-object-entry',{problemParam:'url',problemValue:c});if('undefined'==typeof a)a=new URL(c,location).toString();else if(0===a.length)throw new WorkboxError('invalid-object-entry',{problemParam:'entryID',problemValue:a});super({entryID:a,revision:b||c,request:new Request(c),cacheBust:d});}} 173 | 174 | class RevisionedCacheManager extends BaseCacheManager{constructor(a={}){a.cacheName=a.cacheName||defaultRevisionedCacheName,super(a),this._revisionDetailsModel=new RevisionDetailsModel;}addToCacheList({revisionedFiles:a}={}){isInstance({revisionedFiles:a},Array),super._addEntries(a);const b=a.filter((a)=>'string'==typeof a||!a.revision);0this._close())}_createLogFriendlyString(a){let b=`\n`;return a.forEach((a)=>{b+=` URL: '${a.url}' Revision: `+`'${a.revision}'\n`;}),b}install(){return super.install().then((a)=>{const b=[],c=[];a.forEach((a)=>{a.wasUpdated?b.push({url:a.url,revision:a.revision}):c.push({url:a.url,revision:a.revision});});const d={};return 0{const c=this._revisionedCacheManager.getCachedUrls();0{if(a)return self.skipWaiting()}));}),self.addEventListener('activate',(a)=>{a.waitUntil(this._revisionedCacheManager.cleanup().then(()=>{if(b)return self.clients.claim()}));});}_registerDefaultRoutes(a,b){const c=[];(a||b)&&c.push(this._getCacheMatchPlugin(a,b));const d=this.strategies.cacheFirst({cacheName:this._revisionedCacheManager.getCacheName(),plugins:c,excludeCacheId:!0});this._precacheRouter.registerRoute(({url:c})=>{c.hash='';const d=this._revisionedCacheManager.getCachedUrls();if(-1!==d.indexOf(c.href))return!0;let e=this._removeIgnoreUrlParams(c.href,a);return-1!==d.indexOf(e.href)||b&&e.pathname.endsWith('/')&&(e.pathname+=b,-1!==d.indexOf(e.href))},d);}_getCacheMatchPlugin(a,b){var c=this;const d=(()=>{var d=asyncToGenerator(function*({request:d,cache:e,cachedResponse:f,matchOptions:g}){if(f)return f;let h=c._removeIgnoreUrlParams(d.url,a);return e.match(h.toString(),g).then(function(a){return!a&&h.pathname.endsWith('/')?(h.pathname+=b,e.match(h.toString(),g)):a})});return function(){return d.apply(this,arguments)}})();return{cachedResponseWillBeUsed:d}}_removeIgnoreUrlParams(a,b){const c=new URL(a),d=c.search.slice(1),e=d.split('&'),f=e.map((a)=>a.split('=')),g=f.filter((a)=>b.every((b)=>!b.test(a[0]))),h=g.map((a)=>a.join('='));return c.search=h.join('&'),c}} 183 | 184 | return WorkboxSW$1; 185 | 186 | }()); 187 | //# sourceMappingURL=workbox-sw.prod.v2.1.3.js.map 188 | -------------------------------------------------------------------------------- /src/.nuxt/empty.js: -------------------------------------------------------------------------------- 1 | // This file is intentionally left empty for noop aliases 2 | -------------------------------------------------------------------------------- /src/.nuxt/index.js: -------------------------------------------------------------------------------- 1 | import 'es6-promise/auto' 2 | import Vue from 'vue' 3 | import Meta from 'vue-meta' 4 | import { createRouter } from './router.js' 5 | import NoSSR from './components/no-ssr.js' 6 | import NuxtChild from './components/nuxt-child.js' 7 | import NuxtLink from './components/nuxt-link.js' 8 | import NuxtError from './components/nuxt-error.vue' 9 | import Nuxt from './components/nuxt.js' 10 | import App from './App.js' 11 | import { setContext, getLocation, getRouteData } from './utils' 12 | import { createStore } from './store.js' 13 | 14 | /* Plugins */ 15 | import nuxt_plugin_swplugin_34e1b46f from 'nuxt_plugin_swplugin_34e1b46f' // Source: ./sw.plugin.js (ssr: false) 16 | 17 | 18 | // Component: 19 | Vue.component(NoSSR.name, NoSSR) 20 | 21 | // Component: 22 | Vue.component(NuxtChild.name, NuxtChild) 23 | 24 | // Component: 25 | Vue.component(NuxtLink.name, NuxtLink) 26 | 27 | // Component: ` 28 | Vue.component(Nuxt.name, Nuxt) 29 | 30 | // vue-meta configuration 31 | Vue.use(Meta, { 32 | keyName: 'head', // the component option name that vue-meta looks for meta info on. 33 | attribute: 'data-n-head', // the attribute name vue-meta adds to the tags it observes 34 | ssrAttribute: 'data-n-head-ssr', // the attribute name that lets vue-meta know that meta info has already been server-rendered 35 | tagIDKeyName: 'hid' // the property name that vue-meta uses to determine whether to overwrite or append a tag 36 | }) 37 | 38 | const defaultTransition = {"name":"page","mode":"out-in","appear":false,"appearClass":"appear","appearActiveClass":"appear-active","appearToClass":"appear-to"} 39 | 40 | async function createApp (ssrContext) { 41 | const router = await createRouter(ssrContext) 42 | 43 | 44 | const store = createStore(ssrContext) 45 | // Add this.$router into store actions/mutations 46 | store.$router = router 47 | 48 | 49 | // Create Root instance 50 | // here we inject the router and store to all child components, 51 | // making them available everywhere as `this.$router` and `this.$store`. 52 | const app = { 53 | router, 54 | store, 55 | nuxt: { 56 | defaultTransition, 57 | transitions: [ defaultTransition ], 58 | setTransitions (transitions) { 59 | if (!Array.isArray(transitions)) { 60 | transitions = [ transitions ] 61 | } 62 | transitions = transitions.map((transition) => { 63 | if (!transition) { 64 | transition = defaultTransition 65 | } else if (typeof transition === 'string') { 66 | transition = Object.assign({}, defaultTransition, { name: transition }) 67 | } else { 68 | transition = Object.assign({}, defaultTransition, transition) 69 | } 70 | return transition 71 | }) 72 | this.$options.nuxt.transitions = transitions 73 | return transitions 74 | }, 75 | err: null, 76 | dateErr: null, 77 | error (err) { 78 | err = err || null 79 | app.context._errored = !!err 80 | if (typeof err === 'string') err = { statusCode: 500, message: err } 81 | const nuxt = this.nuxt || this.$options.nuxt 82 | nuxt.dateErr = Date.now() 83 | nuxt.err = err 84 | // Used in lib/server.js 85 | if (ssrContext) ssrContext.nuxt.error = err 86 | return err 87 | } 88 | }, 89 | ...App 90 | } 91 | 92 | // Make app available into store via this.app 93 | store.app = app 94 | 95 | const next = ssrContext ? ssrContext.next : location => app.router.push(location) 96 | // Resolve route 97 | let route 98 | if (ssrContext) { 99 | route = router.resolve(ssrContext.url).route 100 | } else { 101 | const path = getLocation(router.options.base) 102 | route = router.resolve(path).route 103 | } 104 | 105 | // Set context to app.context 106 | await setContext(app, { 107 | route, 108 | next, 109 | error: app.nuxt.error.bind(app), 110 | store, 111 | payload: ssrContext ? ssrContext.payload : undefined, 112 | req: ssrContext ? ssrContext.req : undefined, 113 | res: ssrContext ? ssrContext.res : undefined, 114 | beforeRenderFns: ssrContext ? ssrContext.beforeRenderFns : undefined 115 | }) 116 | 117 | const inject = function (key, value) { 118 | if (!key) throw new Error('inject(key, value) has no key provided') 119 | if (!value) throw new Error('inject(key, value) has no value provided') 120 | key = '$' + key 121 | // Add into app 122 | app[key] = value 123 | 124 | // Add into store 125 | store[key] = app[key] 126 | 127 | // Check if plugin not already installed 128 | const installKey = '__nuxt_' + key + '_installed__' 129 | if (Vue[installKey]) return 130 | Vue[installKey] = true 131 | // Call Vue.use() to install the plugin into vm 132 | Vue.use(() => { 133 | if (!Vue.prototype.hasOwnProperty(key)) { 134 | Object.defineProperty(Vue.prototype, key, { 135 | get () { 136 | return this.$root.$options[key] 137 | } 138 | }) 139 | } 140 | }) 141 | } 142 | 143 | 144 | if (process.browser) { 145 | // Replace store state before plugins execution 146 | if (window.__NUXT__ && window.__NUXT__.state) { 147 | store.replaceState(window.__NUXT__.state) 148 | } 149 | } 150 | 151 | 152 | // Plugin execution 153 | 154 | 155 | if (process.browser) { 156 | if (typeof nuxt_plugin_swplugin_34e1b46f === 'function') await nuxt_plugin_swplugin_34e1b46f(app.context, inject) 157 | } 158 | 159 | // If server-side, wait for async component to be resolved first 160 | if (process.server && ssrContext && ssrContext.url) { 161 | await new Promise((resolve, reject) => { 162 | router.push(ssrContext.url, resolve, () => { 163 | // navigated to a different route in router guard 164 | const unregister = router.afterEach(async (to, from, next) => { 165 | ssrContext.url = to.fullPath 166 | app.context.route = await getRouteData(to) 167 | app.context.params = to.params || {} 168 | app.context.query = to.query || {} 169 | unregister() 170 | resolve() 171 | }) 172 | }) 173 | }) 174 | } 175 | 176 | return { 177 | app, 178 | router, 179 | store 180 | } 181 | } 182 | 183 | export { createApp, NuxtError } 184 | -------------------------------------------------------------------------------- /src/.nuxt/loading.html: -------------------------------------------------------------------------------- 1 | 98 | 99 | 105 | 106 |
Loading...
107 | 108 | 109 | -------------------------------------------------------------------------------- /src/.nuxt/middleware.js: -------------------------------------------------------------------------------- 1 | 2 | let files = require.context('@/middleware', false, /^\.\/(?!-)[^.]+\.(mjs|js)$/) 3 | let filenames = files.keys() 4 | 5 | function getModule (filename) { 6 | let file = files(filename) 7 | return file.default 8 | ? file.default 9 | : file 10 | } 11 | let middleware = {} 12 | 13 | // Generate the middleware 14 | for (let filename of filenames) { 15 | let name = filename.replace(/^\.\//, '').replace(/\.(mjs|js)$/, '') 16 | middleware[name] = getModule(filename) 17 | } 18 | 19 | export default middleware 20 | 21 | -------------------------------------------------------------------------------- /src/.nuxt/router.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Router from 'vue-router' 3 | 4 | const _01911e7a = () => import('../pages/page3.vue' /* webpackChunkName: "pages/page3" */).then(m => m.default || m) 5 | const _018306f9 = () => import('../pages/page2.vue' /* webpackChunkName: "pages/page2" */).then(m => m.default || m) 6 | const _c189fe70 = () => import('../pages/index.vue' /* webpackChunkName: "pages/index" */).then(m => m.default || m) 7 | 8 | Vue.use(Router) 9 | 10 | 11 | if (process.client) { 12 | window.history.scrollRestoration = 'manual' 13 | } 14 | const scrollBehavior = function (to, from, savedPosition) { 15 | // if the returned position is falsy or an empty object, 16 | // will retain current scroll position. 17 | let position = false 18 | 19 | // if no children detected 20 | if (to.matched.length < 2) { 21 | // scroll to the top of the page 22 | position = { x: 0, y: 0 } 23 | } else if (to.matched.some((r) => r.components.default.options.scrollToTop)) { 24 | // if one of the children has scrollToTop option set to true 25 | position = { x: 0, y: 0 } 26 | } 27 | 28 | // savedPosition is only available for popstate navigations (back button) 29 | if (savedPosition) { 30 | position = savedPosition 31 | } 32 | 33 | return new Promise(resolve => { 34 | // wait for the out transition to complete (if necessary) 35 | window.$nuxt.$once('triggerScroll', () => { 36 | // coords will be used if no selector is provided, 37 | // or if the selector didn't match any element. 38 | if (to.hash) { 39 | let hash = to.hash 40 | // CSS.escape() is not supported with IE and Edge. 41 | if (typeof window.CSS !== 'undefined' && typeof window.CSS.escape !== 'undefined') { 42 | hash = '#' + window.CSS.escape(hash.substr(1)) 43 | } 44 | try { 45 | if (document.querySelector(hash)) { 46 | // scroll to anchor by returning the selector 47 | position = { selector: hash } 48 | } 49 | } catch (e) { 50 | console.warn('Failed to save scroll position. Please add CSS.escape() polyfill (https://github.com/mathiasbynens/CSS.escape).') 51 | } 52 | } 53 | resolve(position) 54 | }) 55 | }) 56 | } 57 | 58 | 59 | export function createRouter () { 60 | return new Router({ 61 | mode: 'history', 62 | base: '/', 63 | linkActiveClass: 'nuxt-link-active', 64 | linkExactActiveClass: 'nuxt-link-exact-active', 65 | scrollBehavior, 66 | routes: [ 67 | { 68 | path: "/page3", 69 | component: _01911e7a, 70 | name: "page3" 71 | }, 72 | { 73 | path: "/page2", 74 | component: _018306f9, 75 | name: "page2" 76 | }, 77 | { 78 | path: "/", 79 | component: _c189fe70, 80 | name: "index" 81 | } 82 | ], 83 | 84 | 85 | fallback: false 86 | }) 87 | } 88 | -------------------------------------------------------------------------------- /src/.nuxt/server.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { stringify } from 'querystring' 3 | import omit from 'lodash/omit' 4 | import middleware from './middleware' 5 | import { createApp, NuxtError } from './index' 6 | import { applyAsyncData, sanitizeComponent, getMatchedComponents, getContext, middlewareSeries, promisify, urlJoin } from './utils' 7 | 8 | const debug = require('debug')('nuxt:render') 9 | debug.color = 4 // force blue color 10 | 11 | const isDev = false 12 | 13 | const noopApp = () => new Vue({ render: (h) => h('div') }) 14 | 15 | const createNext = ssrContext => opts => { 16 | ssrContext.redirected = opts 17 | // If nuxt generate 18 | if (!ssrContext.res) { 19 | ssrContext.nuxt.serverRendered = false 20 | return 21 | } 22 | opts.query = stringify(opts.query) 23 | opts.path = opts.path + (opts.query ? '?' + opts.query : '') 24 | if (opts.path.indexOf('http') !== 0 && ('/' !== '/' && opts.path.indexOf('/') !== 0)) { 25 | opts.path = urlJoin('/', opts.path) 26 | } 27 | // Avoid loop redirect 28 | if (opts.path === ssrContext.url) { 29 | ssrContext.redirected = false 30 | return 31 | } 32 | ssrContext.res.writeHead(opts.status, { 33 | 'Location': opts.path 34 | }) 35 | ssrContext.res.end() 36 | } 37 | 38 | // This exported function will be called by `bundleRenderer`. 39 | // This is where we perform data-prefetching to determine the 40 | // state of our application before actually rendering it. 41 | // Since data fetching is async, this function is expected to 42 | // return a Promise that resolves to the app instance. 43 | export default async ssrContext => { 44 | // Create ssrContext.next for simulate next() of beforeEach() when wanted to redirect 45 | ssrContext.redirected = false 46 | ssrContext.next = createNext(ssrContext) 47 | // Used for beforeNuxtRender({ Components, nuxtState }) 48 | ssrContext.beforeRenderFns = [] 49 | // Nuxt object (window.__NUXT__) 50 | ssrContext.nuxt = { layout: 'default', data: [], error: null, state: null, serverRendered: true } 51 | // Create the app definition and the instance (created for each request) 52 | const { app, router, store } = await createApp(ssrContext) 53 | const _app = new Vue(app) 54 | 55 | // Add meta infos (used in renderer.js) 56 | ssrContext.meta = _app.$meta() 57 | // Keep asyncData for each matched component in ssrContext (used in app/utils.js via this.$ssrContext) 58 | ssrContext.asyncData = {} 59 | 60 | const beforeRender = async () => { 61 | // Call beforeNuxtRender() methods 62 | await Promise.all(ssrContext.beforeRenderFns.map((fn) => promisify(fn, { Components, nuxtState: ssrContext.nuxt }))) 63 | 64 | // Add the state from the vuex store 65 | ssrContext.nuxt.state = store.state 66 | 67 | } 68 | const renderErrorPage = async () => { 69 | // Load layout for error page 70 | let errLayout = (typeof NuxtError.layout === 'function' ? NuxtError.layout(app.context) : NuxtError.layout) 71 | ssrContext.nuxt.layout = errLayout || 'default' 72 | await _app.loadLayout(errLayout) 73 | _app.setLayout(errLayout) 74 | await beforeRender() 75 | return _app 76 | } 77 | const render404Page = () => { 78 | app.context.error({ statusCode: 404, path: ssrContext.url, message: 'This page could not be found' }) 79 | return renderErrorPage() 80 | } 81 | 82 | 83 | 84 | // Components are already resolved by setContext -> getRouteData (app/utils.js) 85 | const Components = getMatchedComponents(router.match(ssrContext.url)) 86 | 87 | 88 | /* 89 | ** Dispatch store nuxtServerInit 90 | */ 91 | if (store._actions && store._actions.nuxtServerInit) { 92 | try { 93 | await store.dispatch('nuxtServerInit', app.context) 94 | } catch (err) { 95 | debug('error occurred when calling nuxtServerInit: ', err.message) 96 | throw err 97 | } 98 | } 99 | // ...If there is a redirect or an error, stop the process 100 | if (ssrContext.redirected) return noopApp() 101 | if (ssrContext.nuxt.error) return renderErrorPage() 102 | 103 | 104 | /* 105 | ** Call global middleware (nuxt.config.js) 106 | */ 107 | let midd = [] 108 | midd = midd.map((name) => { 109 | if (typeof name === 'function') return name 110 | if (typeof middleware[name] !== 'function') { 111 | app.context.error({ statusCode: 500, message: 'Unknown middleware ' + name }) 112 | } 113 | return middleware[name] 114 | }) 115 | await middlewareSeries(midd, app.context) 116 | // ...If there is a redirect or an error, stop the process 117 | if (ssrContext.redirected) return noopApp() 118 | if (ssrContext.nuxt.error) return renderErrorPage() 119 | 120 | /* 121 | ** Set layout 122 | */ 123 | let layout = Components.length ? Components[0].options.layout : NuxtError.layout 124 | if (typeof layout === 'function') layout = layout(app.context) 125 | await _app.loadLayout(layout) 126 | layout = _app.setLayout(layout) 127 | // ...Set layout to __NUXT__ 128 | ssrContext.nuxt.layout = _app.layoutName 129 | 130 | /* 131 | ** Call middleware (layout + pages) 132 | */ 133 | midd = [] 134 | if (layout.middleware) midd = midd.concat(layout.middleware) 135 | Components.forEach((Component) => { 136 | if (Component.options.middleware) { 137 | midd = midd.concat(Component.options.middleware) 138 | } 139 | }) 140 | midd = midd.map((name) => { 141 | if (typeof name === 'function') return name 142 | if (typeof middleware[name] !== 'function') { 143 | app.context.error({ statusCode: 500, message: 'Unknown middleware ' + name }) 144 | } 145 | return middleware[name] 146 | }) 147 | await middlewareSeries(midd, app.context) 148 | // ...If there is a redirect or an error, stop the process 149 | if (ssrContext.redirected) return noopApp() 150 | if (ssrContext.nuxt.error) return renderErrorPage() 151 | 152 | /* 153 | ** Call .validate() 154 | */ 155 | let isValid = true 156 | Components.forEach((Component) => { 157 | if (!isValid) return 158 | if (typeof Component.options.validate !== 'function') return 159 | isValid = Component.options.validate(app.context) 160 | }) 161 | // ...If .validate() returned false 162 | if (!isValid) { 163 | // Don't server-render the page in generate mode 164 | if (ssrContext._generate) ssrContext.nuxt.serverRendered = false 165 | // Render a 404 error page 166 | return render404Page() 167 | } 168 | 169 | // If no Components found, returns 404 170 | if (!Components.length) return render404Page() 171 | 172 | // Call asyncData & fetch hooks on components matched by the route. 173 | let asyncDatas = await Promise.all(Components.map(Component => { 174 | let promises = [] 175 | 176 | // Call asyncData(context) 177 | if (Component.options.asyncData && typeof Component.options.asyncData === 'function') { 178 | let promise = promisify(Component.options.asyncData, app.context) 179 | promise.then(asyncDataResult => { 180 | ssrContext.asyncData[Component.cid] = asyncDataResult 181 | applyAsyncData(Component) 182 | return asyncDataResult 183 | }) 184 | promises.push(promise) 185 | } else { 186 | promises.push(null) 187 | } 188 | 189 | // Call fetch(context) 190 | if (Component.options.fetch) { 191 | promises.push(Component.options.fetch(app.context)) 192 | } 193 | else { 194 | promises.push(null) 195 | } 196 | 197 | return Promise.all(promises) 198 | })) 199 | 200 | 201 | 202 | // datas are the first row of each 203 | ssrContext.nuxt.data = asyncDatas.map(r => r[0] || {}) 204 | 205 | // ...If there is a redirect or an error, stop the process 206 | if (ssrContext.redirected) return noopApp() 207 | if (ssrContext.nuxt.error) return renderErrorPage() 208 | 209 | // Call beforeNuxtRender methods & add store state 210 | await beforeRender() 211 | 212 | return _app 213 | } 214 | -------------------------------------------------------------------------------- /src/.nuxt/store.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Vuex from 'vuex' 3 | 4 | Vue.use(Vuex) 5 | 6 | // Recursive find files in {srcDir}/{dir.store} 7 | const files = require.context('@/store', true, /^\.\/(?!-)[^.]+\.(mjs|js)$/) 8 | const filenames = files.keys() 9 | 10 | // Store 11 | let storeData = {} 12 | 13 | // Check if {dir.store}/index.js exists 14 | let indexFilename 15 | filenames.forEach((filename) => { 16 | if (filename.indexOf('./index.') !== -1) { 17 | indexFilename = filename 18 | } 19 | }) 20 | if (indexFilename) { 21 | storeData = getModule(indexFilename) 22 | } 23 | 24 | // If store is not an exported method = modules store 25 | if (typeof storeData !== 'function') { 26 | 27 | // Store modules 28 | if (!storeData.modules) { 29 | storeData.modules = {} 30 | } 31 | 32 | for (let filename of filenames) { 33 | let name = filename.replace(/^\.\//, '').replace(/\.(mjs|js)$/, '') 34 | if (name === 'index') continue 35 | 36 | let namePath = name.split(/\//) 37 | let module = getModuleNamespace(storeData, namePath) 38 | 39 | name = namePath.pop() 40 | module[name] = getModule(filename) 41 | module[name].namespaced = true 42 | } 43 | 44 | } 45 | 46 | // createStore 47 | export const createStore = storeData instanceof Function ? storeData : () => { 48 | return new Vuex.Store(Object.assign({ 49 | strict: (process.env.NODE_ENV !== 'production'), 50 | }, storeData, { 51 | state: storeData.state instanceof Function ? storeData.state() : {} 52 | })) 53 | } 54 | 55 | // Dynamically require module 56 | function getModule (filename) { 57 | const file = files(filename) 58 | const module = file.default || file 59 | if (module.commit) { 60 | throw new Error('[nuxt] store/' + filename.replace('./', '') + ' should export a method which returns a Vuex instance.') 61 | } 62 | if (module.state && typeof module.state !== 'function') { 63 | throw new Error('[nuxt] state should be a function in store/' + filename.replace('./', '')) 64 | } 65 | return module 66 | } 67 | 68 | function getModuleNamespace (storeData, namePath) { 69 | if (namePath.length === 1) { 70 | return storeData.modules 71 | } 72 | let namespace = namePath.shift() 73 | storeData.modules[namespace] = storeData.modules[namespace] || {} 74 | storeData.modules[namespace].namespaced = true 75 | storeData.modules[namespace].modules = storeData.modules[namespace].modules || {} 76 | return getModuleNamespace(storeData.modules[namespace], namePath) 77 | } 78 | -------------------------------------------------------------------------------- /src/.nuxt/utils.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | 3 | const noopData = () => ({}) 4 | 5 | // window.onNuxtReady(() => console.log('Ready')) hook 6 | // Useful for jsdom testing or plugins (https://github.com/tmpvar/jsdom#dealing-with-asynchronous-script-loading) 7 | if (process.browser) { 8 | window._nuxtReadyCbs = [] 9 | window.onNuxtReady = function (cb) { 10 | window._nuxtReadyCbs.push(cb) 11 | } 12 | } 13 | 14 | export function applyAsyncData(Component, asyncData) { 15 | const ComponentData = Component.options.data || noopData 16 | // Prevent calling this method for each request on SSR context 17 | if (!asyncData && Component.options.hasAsyncData) { 18 | return 19 | } 20 | Component.options.hasAsyncData = true 21 | Component.options.data = function () { 22 | const data = ComponentData.call(this) 23 | if (this.$ssrContext) { 24 | asyncData = this.$ssrContext.asyncData[Component.cid] 25 | } 26 | return { ...data, ...asyncData } 27 | } 28 | if (Component._Ctor && Component._Ctor.options) { 29 | Component._Ctor.options.data = Component.options.data 30 | } 31 | } 32 | 33 | export function sanitizeComponent(Component) { 34 | // If Component already sanitized 35 | if (Component.options && Component._Ctor === Component) { 36 | return Component 37 | } 38 | if (!Component.options) { 39 | Component = Vue.extend(Component) // fix issue #6 40 | Component._Ctor = Component 41 | } else { 42 | Component._Ctor = Component 43 | Component.extendOptions = Component.options 44 | } 45 | // For debugging purpose 46 | if (!Component.options.name && Component.options.__file) { 47 | Component.options.name = Component.options.__file 48 | } 49 | return Component 50 | } 51 | 52 | export function getMatchedComponents(route, matches = false) { 53 | return [].concat.apply([], route.matched.map(function (m, index) { 54 | return Object.keys(m.components).map(function (key) { 55 | matches && matches.push(index) 56 | return m.components[key] 57 | }) 58 | })) 59 | } 60 | 61 | export function getMatchedComponentsInstances(route, matches = false) { 62 | return [].concat.apply([], route.matched.map(function (m, index) { 63 | return Object.keys(m.instances).map(function (key) { 64 | matches && matches.push(index) 65 | return m.instances[key] 66 | }) 67 | })) 68 | } 69 | 70 | export function flatMapComponents(route, fn) { 71 | return Array.prototype.concat.apply([], route.matched.map(function (m, index) { 72 | return Object.keys(m.components).map(function (key) { 73 | return fn(m.components[key], m.instances[key], m, key, index) 74 | }) 75 | })) 76 | } 77 | 78 | export function resolveRouteComponents(route) { 79 | return Promise.all( 80 | flatMapComponents(route, async (Component, _, match, key) => { 81 | // If component is a function, resolve it 82 | if (typeof Component === 'function' && !Component.options) { 83 | Component = await Component() 84 | } 85 | return match.components[key] = sanitizeComponent(Component) 86 | }) 87 | ) 88 | } 89 | 90 | export async function getRouteData(route) { 91 | // Make sure the components are resolved (code-splitting) 92 | await resolveRouteComponents(route) 93 | // Send back a copy of route with meta based on Component definition 94 | return { 95 | ...route, 96 | meta: getMatchedComponents(route).map((Component) => { 97 | return Component.options.meta || {} 98 | }) 99 | } 100 | } 101 | 102 | export async function setContext(app, context) { 103 | const route = (context.to ? context.to : context.route) 104 | // If context not defined, create it 105 | if (!app.context) { 106 | app.context = { 107 | isStatic: process.static, 108 | isDev: false, 109 | isHMR: false, 110 | app, 111 | store: app.store, 112 | payload: context.payload, 113 | error: context.error, 114 | base: '/', 115 | env: {} 116 | } 117 | // Only set once 118 | if (context.req) app.context.req = context.req 119 | if (context.res) app.context.res = context.res 120 | app.context.redirect = function (status, path, query) { 121 | if (!status) return 122 | app.context._redirected = true // Used in middleware 123 | // if only 1 or 2 arguments: redirect('/') or redirect('/', { foo: 'bar' }) 124 | let pathType = typeof path 125 | if (typeof status !== 'number' && (pathType === 'undefined' || pathType === 'object')) { 126 | query = path || {} 127 | path = status 128 | pathType = typeof path 129 | status = 302 130 | } 131 | if (pathType === 'object') { 132 | path = app.router.resolve(path).href 133 | } 134 | // "/absolute/route", "./relative/route" or "../relative/route" 135 | if (/(^[.]{1,2}\/)|(^\/(?!\/))/.test(path)) { 136 | app.context.next({ 137 | path: path, 138 | query: query, 139 | status: status 140 | }) 141 | } else { 142 | path = formatUrl(path, query) 143 | if (process.server) { 144 | app.context.next({ 145 | path: path, 146 | status: status 147 | }) 148 | } 149 | if (process.client) { 150 | // https://developer.mozilla.org/en-US/docs/Web/API/Location/replace 151 | window.location.replace(path) 152 | 153 | // Throw a redirect error 154 | throw new Error('ERR_REDIRECT') 155 | } 156 | } 157 | } 158 | if (process.server) app.context.beforeNuxtRender = (fn) => context.beforeRenderFns.push(fn) 159 | if (process.client) app.context.nuxtState = window.__NUXT__ 160 | } 161 | // Dynamic keys 162 | app.context.next = context.next 163 | app.context._redirected = false 164 | app.context._errored = false 165 | app.context.isHMR = !!context.isHMR 166 | if (context.route) app.context.route = await getRouteData(context.route) 167 | app.context.params = app.context.route.params || {} 168 | app.context.query = app.context.route.query || {} 169 | if (context.from) app.context.from = await getRouteData(context.from) 170 | } 171 | 172 | export function middlewareSeries(promises, appContext) { 173 | if (!promises.length || appContext._redirected || appContext._errored) { 174 | return Promise.resolve() 175 | } 176 | return promisify(promises[0], appContext) 177 | .then(() => { 178 | return middlewareSeries(promises.slice(1), appContext) 179 | }) 180 | } 181 | 182 | export function promisify(fn, context) { 183 | let promise 184 | if (fn.length === 2) { 185 | // fn(context, callback) 186 | promise = new Promise((resolve) => { 187 | fn(context, function (err, data) { 188 | if (err) { 189 | context.error(err) 190 | } 191 | data = data || {} 192 | resolve(data) 193 | }) 194 | }) 195 | } else { 196 | promise = fn(context) 197 | } 198 | if (!promise || (!(promise instanceof Promise) && (typeof promise.then !== 'function'))) { 199 | promise = Promise.resolve(promise) 200 | } 201 | return promise 202 | } 203 | 204 | // Imported from vue-router 205 | export function getLocation(base, mode) { 206 | var path = window.location.pathname 207 | if (mode === 'hash') { 208 | return window.location.hash.replace(/^#\//, '') 209 | } 210 | if (base && path.indexOf(base) === 0) { 211 | path = path.slice(base.length) 212 | } 213 | return (path || '/') + window.location.search + window.location.hash 214 | } 215 | 216 | export function urlJoin() { 217 | return [].slice.call(arguments).join('/').replace(/\/+/g, '/') 218 | } 219 | 220 | // Imported from path-to-regexp 221 | 222 | /** 223 | * Compile a string to a template function for the path. 224 | * 225 | * @param {string} str 226 | * @param {Object=} options 227 | * @return {!function(Object=, Object=)} 228 | */ 229 | export function compile(str, options) { 230 | return tokensToFunction(parse(str, options)) 231 | } 232 | 233 | export function getQueryDiff(toQuery, fromQuery) { 234 | const diff = {} 235 | const queries = { ...toQuery, ...fromQuery } 236 | for (const k in queries) { 237 | if (String(toQuery[k]) !== String(fromQuery[k])) { 238 | diff[k] = true 239 | } 240 | } 241 | return diff 242 | } 243 | 244 | /** 245 | * The main path matching regexp utility. 246 | * 247 | * @type {RegExp} 248 | */ 249 | const PATH_REGEXP = new RegExp([ 250 | // Match escaped characters that would otherwise appear in future matches. 251 | // This allows the user to escape special characters that won't transform. 252 | '(\\\\.)', 253 | // Match Express-style parameters and un-named parameters with a prefix 254 | // and optional suffixes. Matches appear as: 255 | // 256 | // "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined] 257 | // "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined] 258 | // "/*" => ["/", undefined, undefined, undefined, undefined, "*"] 259 | '([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))' 260 | ].join('|'), 'g') 261 | 262 | /** 263 | * Parse a string for the raw tokens. 264 | * 265 | * @param {string} str 266 | * @param {Object=} options 267 | * @return {!Array} 268 | */ 269 | function parse(str, options) { 270 | var tokens = [] 271 | var key = 0 272 | var index = 0 273 | var path = '' 274 | var defaultDelimiter = options && options.delimiter || '/' 275 | var res 276 | 277 | while ((res = PATH_REGEXP.exec(str)) != null) { 278 | var m = res[0] 279 | var escaped = res[1] 280 | var offset = res.index 281 | path += str.slice(index, offset) 282 | index = offset + m.length 283 | 284 | // Ignore already escaped sequences. 285 | if (escaped) { 286 | path += escaped[1] 287 | continue 288 | } 289 | 290 | var next = str[index] 291 | var prefix = res[2] 292 | var name = res[3] 293 | var capture = res[4] 294 | var group = res[5] 295 | var modifier = res[6] 296 | var asterisk = res[7] 297 | 298 | // Push the current path onto the tokens. 299 | if (path) { 300 | tokens.push(path) 301 | path = '' 302 | } 303 | 304 | var partial = prefix != null && next != null && next !== prefix 305 | var repeat = modifier === '+' || modifier === '*' 306 | var optional = modifier === '?' || modifier === '*' 307 | var delimiter = res[2] || defaultDelimiter 308 | var pattern = capture || group 309 | 310 | tokens.push({ 311 | name: name || key++, 312 | prefix: prefix || '', 313 | delimiter: delimiter, 314 | optional: optional, 315 | repeat: repeat, 316 | partial: partial, 317 | asterisk: !!asterisk, 318 | pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?') 319 | }) 320 | } 321 | 322 | // Match any characters still remaining. 323 | if (index < str.length) { 324 | path += str.substr(index) 325 | } 326 | 327 | // If the path exists, push it onto the end. 328 | if (path) { 329 | tokens.push(path) 330 | } 331 | 332 | return tokens 333 | } 334 | 335 | /** 336 | * Prettier encoding of URI path segments. 337 | * 338 | * @param {string} 339 | * @return {string} 340 | */ 341 | function encodeURIComponentPretty(str) { 342 | return encodeURI(str).replace(/[\/?#]/g, function (c) { 343 | return '%' + c.charCodeAt(0).toString(16).toUpperCase() 344 | }) 345 | } 346 | 347 | /** 348 | * Encode the asterisk parameter. Similar to `pretty`, but allows slashes. 349 | * 350 | * @param {string} 351 | * @return {string} 352 | */ 353 | function encodeAsterisk(str) { 354 | return encodeURI(str).replace(/[?#]/g, function (c) { 355 | return '%' + c.charCodeAt(0).toString(16).toUpperCase() 356 | }) 357 | } 358 | 359 | /** 360 | * Expose a method for transforming tokens into the path function. 361 | */ 362 | function tokensToFunction(tokens) { 363 | // Compile all the tokens into regexps. 364 | var matches = new Array(tokens.length) 365 | 366 | // Compile all the patterns before compilation. 367 | for (var i = 0; i < tokens.length; i++) { 368 | if (typeof tokens[i] === 'object') { 369 | matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$') 370 | } 371 | } 372 | 373 | return function(obj, opts) { 374 | var path = '' 375 | var data = obj || {} 376 | var options = opts || {} 377 | var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent 378 | 379 | for (var i = 0; i < tokens.length; i++) { 380 | var token = tokens[i] 381 | 382 | if (typeof token === 'string') { 383 | path += token 384 | 385 | continue 386 | } 387 | 388 | var value = data[token.name] 389 | var segment 390 | 391 | if (value == null) { 392 | if (token.optional) { 393 | // Prepend partial segment prefixes. 394 | if (token.partial) { 395 | path += token.prefix 396 | } 397 | 398 | continue 399 | } else { 400 | throw new TypeError('Expected "' + token.name + '" to be defined') 401 | } 402 | } 403 | 404 | if (Array.isArray(value)) { 405 | if (!token.repeat) { 406 | throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`') 407 | } 408 | 409 | if (value.length === 0) { 410 | if (token.optional) { 411 | continue 412 | } else { 413 | throw new TypeError('Expected "' + token.name + '" to not be empty') 414 | } 415 | } 416 | 417 | for (var j = 0; j < value.length; j++) { 418 | segment = encode(value[j]) 419 | 420 | if (!matches[i].test(segment)) { 421 | throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but received `' + JSON.stringify(segment) + '`') 422 | } 423 | 424 | path += (j === 0 ? token.prefix : token.delimiter) + segment 425 | } 426 | 427 | continue 428 | } 429 | 430 | segment = token.asterisk ? encodeAsterisk(value) : encode(value) 431 | 432 | if (!matches[i].test(segment)) { 433 | throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"') 434 | } 435 | 436 | path += token.prefix + segment 437 | } 438 | 439 | return path 440 | } 441 | } 442 | 443 | /** 444 | * Escape a regular expression string. 445 | * 446 | * @param {string} str 447 | * @return {string} 448 | */ 449 | function escapeString(str) { 450 | return str.replace(/([.+*?=^!:()[\]|\/\\])/g, '\\$1') 451 | } 452 | 453 | /** 454 | * Escape the capturing group by escaping special characters and meaning. 455 | * 456 | * @param {string} group 457 | * @return {string} 458 | */ 459 | function escapeGroup(group) { 460 | return group.replace(/([=!:$\/()])/g, '\\$1') 461 | } 462 | 463 | /** 464 | * Format given url, append query to url query string 465 | * 466 | * @param {string} url 467 | * @param {string} query 468 | * @return {string} 469 | */ 470 | function formatUrl (url, query) { 471 | let protocol 472 | let index = url.indexOf('://') 473 | if (index !== -1) { 474 | protocol = url.substring(0, index) 475 | url = url.substring(index + 3) 476 | } else if (url.indexOf('//') === 0) { 477 | url = url.substring(2) 478 | } 479 | 480 | let parts = url.split('/') 481 | let result = (protocol ? protocol + '://' : '//') + parts.shift() 482 | 483 | let path = parts.filter(Boolean).join('/') 484 | let hash 485 | parts = path.split('#') 486 | if (parts.length === 2) { 487 | path = parts[0] 488 | hash = parts[1] 489 | } 490 | 491 | result += path ? '/' + path : '' 492 | 493 | if (query && JSON.stringify(query) !== '{}') { 494 | result += (url.split('?').length === 2 ? '&' : '?') + formatQuery(query) 495 | } 496 | result += hash ? '#' + hash : '' 497 | 498 | return result 499 | } 500 | 501 | /** 502 | * Transform data object to query string 503 | * 504 | * @param {object} query 505 | * @return {string} 506 | */ 507 | function formatQuery (query) { 508 | return Object.keys(query).sort().map(key => { 509 | var val = query[key] 510 | if (val == null) { 511 | return '' 512 | } 513 | if (Array.isArray(val)) { 514 | return val.slice().map(val2 => [key, '=', val2].join('')).join('&') 515 | } 516 | return key + '=' + val 517 | }).filter(Boolean).join('&') 518 | } 519 | -------------------------------------------------------------------------------- /src/.nuxt/views/app.template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{ HEAD }} 5 | 6 | 7 | {{ APP }} 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/.nuxt/views/error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Server error 5 | 6 | 7 | 10 | 11 | 12 |
13 |
14 | 15 |
Server error
16 |
{{ message }}
17 |
18 | 21 |
22 | 23 | 24 | -------------------------------------------------------------------------------- /src/README.md: -------------------------------------------------------------------------------- 1 | # first 2 | 3 | > Nuxt.js project 4 | 5 | ## Build Setup 6 | 7 | ``` bash 8 | # install dependencies 9 | $ npm install # Or yarn install 10 | 11 | # serve with hot reload at localhost:3000 12 | $ npm run dev 13 | 14 | # build for production and launch server 15 | $ npm run build 16 | $ npm start 17 | 18 | # generate static project 19 | $ npm run generate 20 | ``` 21 | 22 | For detailed explanation on how things work, checkout the [Nuxt.js docs](https://github.com/nuxt/nuxt.js). 23 | -------------------------------------------------------------------------------- /src/assets/README.md: -------------------------------------------------------------------------------- 1 | # ASSETS 2 | 3 | This directory contains your un-compiled assets such as LESS, SASS, or JavaScript. 4 | 5 | More information about the usage of this directory in the documentation: 6 | https://nuxtjs.org/guide/assets#webpacked 7 | 8 | **This directory is not required, you can delete it if you don't want to use it.** 9 | -------------------------------------------------------------------------------- /src/assets/styles/main.css: -------------------------------------------------------------------------------- 1 | .mui-appbar { 2 | background-color: #424242; 3 | color: #FFF; 4 | } 5 | 6 | .page-enter-active, .page-leave-active { 7 | transition: all .45s ease-in-out; 8 | transition: all .45s cubic-bezier(.55, 0, .1, 1); 9 | } 10 | 11 | .page-enter, .page-leave-active { 12 | opacity: 0; 13 | transform: translate(10px, 0); 14 | } 15 | 16 | nav { 17 | display: flex; 18 | flex-flow: row wrap; 19 | max-width: 500px; 20 | margin-left: auto; 21 | margin-right: auto; 22 | align-items: center; 23 | height: 64px; 24 | max-width: 450px; 25 | justify-content: center; 26 | } 27 | 28 | nav a { 29 | color: #f9f9f9; 30 | font-weight: 400; 31 | font-size: 1.1em; 32 | margin: 0 1.5em; 33 | border-bottom: 2px solid transparent; 34 | transition: all .2s ease; 35 | text-decoration: none !important; 36 | padding: .5em 1em; 37 | } 38 | 39 | nav a:hover, nav a:focus { 40 | border-bottom: 3px solid #c3e6d978; 41 | } 42 | 43 | .nuxt-link-exact-active { 44 | font-weight: 700; 45 | text-decoration: none; 46 | /* border-bottom: 2px solid white; */ 47 | border-bottom: 3px solid #2196F3; 48 | } 49 | 50 | .nuxt-link-exact-active:hover, .nuxt-link-exact-active:focus { 51 | border-bottom: 3px solid #2196F3; 52 | } 53 | 54 | div#content-wrapper { 55 | 56 | margin: 1em 0; 57 | padding: 1.5em .5em 2.5em .5em; 58 | display: flex; 59 | flex: 1; 60 | } 61 | @media (max-width: 699px) { 62 | div#content-wrapper { 63 | padding: 1em 0 8em 0; 64 | } 65 | } 66 | 67 | span.render-result { 68 | text-transform: capitalize; 69 | color: #424242; 70 | font-style: italic; 71 | font-weight: 600; 72 | margin-left: .5em; 73 | } 74 | 75 | #content-wrapper .headline { 76 | margin-top: 2em; 77 | } 78 | 79 | #reload-btn { 80 | /* margin-top: 3.5em; */ 81 | } 82 | 83 | @media (max-width: 849px) { 84 | nav { 85 | justify-content: space-around; 86 | } 87 | nav a { 88 | margin: 0 .5em; 89 | } 90 | } 91 | 92 | .mui-container .mui-btn--primary { 93 | background: rgb(0, 112, 185); 94 | } 95 | -------------------------------------------------------------------------------- /src/components/AppFooter.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 19 | 20 | 44 | -------------------------------------------------------------------------------- /src/components/AppHeader.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 16 | 17 | 31 | -------------------------------------------------------------------------------- /src/components/Logo.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 81 | -------------------------------------------------------------------------------- /src/layouts/default.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 24 | 25 | 32 | -------------------------------------------------------------------------------- /src/middleware/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidroyer/nuxt2-ssr-firebase/c7fce7b4b83d5b05671beab59cd943539c378b46/src/middleware/.gitkeep -------------------------------------------------------------------------------- /src/nuxt.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | debug: true, 3 | /* 4 | ** Headers of the page 5 | */ 6 | head: { 7 | title: "Nuxt.js 2 - SSR on Firebase Functions", 8 | 9 | meta: [ 10 | { 11 | charset: "utf-8" 12 | }, 13 | { 14 | name: "viewport", 15 | content: "width=device-width, initial-scale=1" 16 | }, 17 | { 18 | property: "og:title", 19 | content: "Nuxt.js 2 - SSR on Firebase Functions" 20 | }, 21 | { 22 | property: "og:description", 23 | content: 24 | "Nuxt.js 2 app with SSR using Firebase Cloud Functions and Firebase Hosting. Made by David Royer" 25 | }, 26 | { 27 | property: "og:image", 28 | content: "https://nuxt2ssrfire.firebaseapp.com/site.jpg" 29 | }, 30 | { 31 | property: "twitter:card", 32 | content: "summary_large_image" 33 | }, 34 | { 35 | property: "twitter:site", 36 | content: "@davidroyer_" 37 | }, 38 | { 39 | property: "twitter:creator", 40 | content: "@davidroyer_" 41 | }, 42 | { 43 | hid: "description", 44 | name: "description", 45 | content: 46 | "Nuxt.js 2 app with SSR using Firebase Cloud Functions and Firebase Hosting. Made by David Royer" 47 | } 48 | ], 49 | link: [ 50 | { 51 | rel: "icon", 52 | type: "image/x-icon", 53 | href: "/favicon.ico" 54 | }, 55 | { 56 | rel: "stylesheet", 57 | href: "https://fonts.googleapis.com/css?family=Roboto" 58 | }, 59 | { 60 | rel: "stylesheet", 61 | href: "https://cdn.muicss.com/mui-0.9.35/css/mui.min.css" 62 | } 63 | ] 64 | }, 65 | /* 66 | ** Customize the progress bar color 67 | */ 68 | loading: { 69 | color: "#3B8070" 70 | }, 71 | 72 | manifest: { 73 | theme_color: "#3B8070" 74 | }, 75 | /* 76 | ** Modules 77 | */ 78 | modules: ["@nuxtjs/pwa"], 79 | 80 | /* 81 | ** Global CSS 82 | */ 83 | css: ["~/assets/styles/main.css"], 84 | buildDir: "./../prod/server/nuxt", 85 | build: { 86 | publicPath: "/assets/", 87 | cache: true, 88 | // babel: { 89 | // presets: [ 90 | // [ 91 | // 'babel-preset-vue-app', 92 | // { 93 | // targets: process.server ? 94 | // { 95 | // node: '6.14.0' 96 | // } : 97 | // { 98 | // ie: 9, 99 | // uglify: true 100 | // } 101 | // } 102 | // ] 103 | // ] 104 | // }, 105 | /* 106 | ** Run ESLINT on save 107 | */ 108 | extend(config, ctx) { 109 | if (process.browser) { 110 | config.module.rules.push({ 111 | enforce: "pre", 112 | test: /\.(js|vue)$/, 113 | loader: "eslint-loader", 114 | exclude: /(node_modules)/ 115 | }); 116 | } 117 | } 118 | } 119 | }; 120 | -------------------------------------------------------------------------------- /src/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nuxt-ssr-firebase-source", 3 | "scripts": { 4 | "dev": "nuxt", 5 | "build": "nuxt build", 6 | "start": "nuxt start", 7 | "generate": "nuxt generate", 8 | "lint": "eslint --ext .js,.vue --ignore-path .gitignore .", 9 | "precommit": "npm run lint" 10 | }, 11 | "dependencies": { 12 | "@nuxtjs/pwa": "^2.0.8", 13 | "nuxt-edge": "^2.0.0-25452542.7f9d16c" 14 | }, 15 | "devDependencies": { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/pages/index.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 36 | -------------------------------------------------------------------------------- /src/pages/page2.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 30 | -------------------------------------------------------------------------------- /src/pages/page3.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 30 | -------------------------------------------------------------------------------- /src/plugins/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidroyer/nuxt2-ssr-firebase/c7fce7b4b83d5b05671beab59cd943539c378b46/src/plugins/.gitkeep -------------------------------------------------------------------------------- /src/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidroyer/nuxt2-ssr-firebase/c7fce7b4b83d5b05671beab59cd943539c378b46/src/static/favicon.ico -------------------------------------------------------------------------------- /src/static/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidroyer/nuxt2-ssr-firebase/c7fce7b4b83d5b05671beab59cd943539c378b46/src/static/icon.png -------------------------------------------------------------------------------- /src/static/site.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidroyer/nuxt2-ssr-firebase/c7fce7b4b83d5b05671beab59cd943539c378b46/src/static/site.jpg -------------------------------------------------------------------------------- /src/store/index.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidroyer/nuxt2-ssr-firebase/c7fce7b4b83d5b05671beab59cd943539c378b46/src/store/index.js -------------------------------------------------------------------------------- /yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | balanced-match@^1.0.0: 6 | version "1.0.0" 7 | resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" 8 | 9 | brace-expansion@^1.1.7: 10 | version "1.1.11" 11 | resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" 12 | dependencies: 13 | balanced-match "^1.0.0" 14 | concat-map "0.0.1" 15 | 16 | concat-map@0.0.1: 17 | version "0.0.1" 18 | resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" 19 | 20 | cross-env@^5.0.5: 21 | version "5.1.6" 22 | resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-5.1.6.tgz#0dc05caf945b24e4b9e3b12871fe0e858d08b38d" 23 | dependencies: 24 | cross-spawn "^5.1.0" 25 | is-windows "^1.0.0" 26 | 27 | cross-spawn@^5.1.0: 28 | version "5.1.0" 29 | resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" 30 | dependencies: 31 | lru-cache "^4.0.1" 32 | shebang-command "^1.2.0" 33 | which "^1.2.9" 34 | 35 | fs.realpath@^1.0.0: 36 | version "1.0.0" 37 | resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" 38 | 39 | glob@^7.0.5: 40 | version "7.1.2" 41 | resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" 42 | dependencies: 43 | fs.realpath "^1.0.0" 44 | inflight "^1.0.4" 45 | inherits "2" 46 | minimatch "^3.0.4" 47 | once "^1.3.0" 48 | path-is-absolute "^1.0.0" 49 | 50 | inflight@^1.0.4: 51 | version "1.0.6" 52 | resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" 53 | dependencies: 54 | once "^1.3.0" 55 | wrappy "1" 56 | 57 | inherits@2: 58 | version "2.0.3" 59 | resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" 60 | 61 | is-windows@^1.0.0: 62 | version "1.0.2" 63 | resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" 64 | 65 | isexe@^2.0.0: 66 | version "2.0.0" 67 | resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" 68 | 69 | lru-cache@^4.0.1: 70 | version "4.1.3" 71 | resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.3.tgz#a1175cf3496dfc8436c156c334b4955992bce69c" 72 | dependencies: 73 | pseudomap "^1.0.2" 74 | yallist "^2.1.2" 75 | 76 | minimatch@^3.0.4: 77 | version "3.0.4" 78 | resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" 79 | dependencies: 80 | brace-expansion "^1.1.7" 81 | 82 | once@^1.3.0: 83 | version "1.4.0" 84 | resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" 85 | dependencies: 86 | wrappy "1" 87 | 88 | path-is-absolute@^1.0.0: 89 | version "1.0.1" 90 | resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" 91 | 92 | pseudomap@^1.0.2: 93 | version "1.0.2" 94 | resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" 95 | 96 | rimraf@^2.6.2: 97 | version "2.6.2" 98 | resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" 99 | dependencies: 100 | glob "^7.0.5" 101 | 102 | shebang-command@^1.2.0: 103 | version "1.2.0" 104 | resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" 105 | dependencies: 106 | shebang-regex "^1.0.0" 107 | 108 | shebang-regex@^1.0.0: 109 | version "1.0.0" 110 | resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" 111 | 112 | which@^1.2.9: 113 | version "1.3.1" 114 | resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" 115 | dependencies: 116 | isexe "^2.0.0" 117 | 118 | wrappy@1: 119 | version "1.0.2" 120 | resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" 121 | 122 | yallist@^2.1.2: 123 | version "2.1.2" 124 | resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" 125 | --------------------------------------------------------------------------------