{"_id":"prerender-loader","_rev":"5-f01bba0695a0a3d792b99bfa934d23e7","name":"prerender-loader","dist-tags":{"latest":"1.3.0"},"versions":{"1.0.0":{"name":"prerender-loader","version":"1.0.0","description":"Webpack plugin to inline critical CSS and lazy-load the rest.","main":"dist/prerender-loader.js","source":"src/index.js","license":"Apache-2.0","author":{"name":"The Chromium Authors"},"contributors":[{"name":"Jason Miller","email":"developit@google.com"}],"keywords":["pre-render","prerendering","webpack plugin","SSR","performance","first contentful paint","FCP"],"repository":{"type":"git","url":"git+https://github.com/GoogleChromeLabs/prerender-loader.git"},"scripts":{"build":"microbundle -f cjs --no-compress --external all","docs":"documentation readme -q --no-markdown-toc -a public -s Usage --sort-order alpha src","test":"jest --coverage"},"babel":{"presets":["env"]},"jest":{"testEnvironment":"node","coverageReporters":["text"],"collectCoverageFrom":["src/**/*"],"watchPathIgnorePatterns":["node_modules","dist"]},"devDependencies":{"babel-core":"^6.26.3","babel-jest":"^23.0.0","babel-preset-env":"^1.7.0","documentation":"^7.0.0","eslint":"^4.19.1","eslint-config-standard":"^11.0.0","eslint-plugin-import":"^2.12.0","eslint-plugin-jest":"^21.15.2","eslint-plugin-node":"^6.0.1","eslint-plugin-promise":"^3.8.0","eslint-plugin-standard":"^3.1.0","file-loader":"^1.1.11","html-webpack-plugin":"^3.2.0","jest":"^23.0.0","memory-fs":"^0.4.1","microbundle":"^0.4.4","raw-loader":"^0.5.1","webpack":"^4.8.3"},"dependencies":{"jsdom":"^11.11.0","loader-utils":"^1.1.0"},"peerDependencies":{"webpack":"*","memory-fs":"*"},"eslintConfig":{"extends":["standard","plugin:jest/recommended"],"env":{"browser":false,"node":true},"rules":{"indent":[2,2],"semi":[2,"always"],"prefer-const":1}},"gitHead":"e03b6d8c2f4f3e3fa2f6efaf9d90fb9a7a8260a5","bugs":{"url":"https://github.com/GoogleChromeLabs/prerender-loader/issues"},"homepage":"https://github.com/GoogleChromeLabs/prerender-loader#readme","_id":"prerender-loader@1.0.0","_npmVersion":"5.7.1","_nodeVersion":"8.9.4","_npmUser":{"name":"developit","email":"jason@developit.ca"},"dist":{"integrity":"sha512-OJ6RSrI/OIRGkXHT0Iao5bqpe81eOMZSuq465UuVtDQdeVg5qwwIPzhIq83jWDBSI+3uHZwF3gsVXmiymoD/lw==","shasum":"145e279f4ef46018e2a816ed01b71e7b0b370f3c","tarball":"https://registry.npmjs.org/prerender-loader/-/prerender-loader-1.0.0.tgz","fileCount":38,"unpackedSize":75728,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbDuaBCRA9TVsSAnZWagAAwewP/26CnqpMg8TrHUUO+YfU\nXxaoOMcZazRrDMPRWqo78nFJ0H4rTvAJU8gMlY677TPPY/NI/LTA/hxoDE8c\nF9WN4z45HwnBAxzzkA5Tn5RZ5Y5rsKewpOX34tlFibqyMHKUNLd5s7VIJPQw\nGBBDYL0OeqPDFjc2uM0TChTlRO/a/ETl7ya8LAvOMRHANkFnWFFBOIQPrDLJ\nBfCNu4wkhBO3cyIIu4aj5G36iUQwqe4Fqko/TuQuNE6CDawZvvAcP+jaUal5\nbPOklL2XkR8wTBwdM6QPClc9MgU668tCQd36wKd8u/qu3Uw8kXv4y05Y+Gho\nKYA4YckVCF+6MvBf/d11tTgAArR4N5VyMznC3sPOuagDGiXQkhcAs1q2HRQ9\nV07aVLkkLH33+iEPNdweQh8VTwg/rjp8veaWsQLQW2RI0n6rInYhUMWNF+af\nw1dwTnSb/1gqR0ut4ZQXlvjEjHbJd8p9Svyh5vZA4/bMz+c080FRXlAT3taK\n4ltOxGCBUi+FVhkYG7zn+/5PFZTQx/jugooSGce4zyXDBH2YZuMye4Nh0idX\nEXM6M2nHTSfPr5pDHcced9MzIWvAAetFiIyiWS2LW6h91zxqi8Dtxvyekhug\nFixPlUHGA5f0l3dj/wqD68YZEKT2m5taiI7Yh3Uxaig1JYzMXRoL1RObKTHn\nLaXw\r\n=Qzoz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICIHS4PHrrklgBuxRZl613jSTwJfeqzDXbSE26QDd8EHAiBbRuYXUKw9zdPIPsSwmxD3nvHy+EPgN791iKnekyIfxw=="}]},"maintainers":[{"name":"developit","email":"jason@developit.ca"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/prerender-loader_1.0.0_1527703167997_0.6194221414450447"},"_hasShrinkwrap":false},"1.1.0":{"name":"prerender-loader","version":"1.1.0","description":"Painless universal prerendering for Webpack. Works great with html-webpack-plugin.","main":"dist/prerender-loader.js","source":"src/index.js","license":"Apache-2.0","author":{"name":"The Chromium Authors"},"contributors":[{"name":"Jason Miller","email":"developit@google.com"}],"keywords":["pre-render","prerendering","webpack plugin","SSR","performance","first contentful paint","FCP"],"repository":{"type":"git","url":"git+https://github.com/GoogleChromeLabs/prerender-loader.git"},"scripts":{"build":"microbundle -f cjs --no-compress --external all","docs":"documentation readme -q --no-markdown-toc -a public -s Usage --sort-order alpha src","test":"jest --coverage"},"babel":{"presets":["env"]},"jest":{"testEnvironment":"node","coverageReporters":["text"],"collectCoverageFrom":["src/**/*"],"watchPathIgnorePatterns":["node_modules","dist"]},"devDependencies":{"babel-core":"^6.26.3","babel-jest":"^23.0.0","babel-preset-env":"^1.7.0","documentation":"^7.0.0","eslint":"^4.19.1","eslint-config-standard":"^11.0.0","eslint-plugin-import":"^2.12.0","eslint-plugin-jest":"^21.15.2","eslint-plugin-node":"^6.0.1","eslint-plugin-promise":"^3.8.0","eslint-plugin-standard":"^3.1.0","file-loader":"^1.1.11","html-webpack-plugin":"^3.2.0","jest":"^23.0.0","memory-fs":"^0.4.1","microbundle":"^0.4.4","raw-loader":"^0.5.1","webpack":"^4.8.3"},"dependencies":{"jsdom":"^11.11.0","loader-utils":"^1.1.0"},"peerDependencies":{"webpack":"*","memory-fs":"*"},"eslintConfig":{"extends":["standard","plugin:jest/recommended"],"env":{"browser":false,"node":true},"rules":{"indent":[2,2],"semi":[2,"always"],"prefer-const":1}},"gitHead":"ce6ad498aa8a87ff84539123f214bf8e6579c442","bugs":{"url":"https://github.com/GoogleChromeLabs/prerender-loader/issues"},"homepage":"https://github.com/GoogleChromeLabs/prerender-loader#readme","_id":"prerender-loader@1.1.0","_npmVersion":"6.4.1","_nodeVersion":"10.9.0","_npmUser":{"name":"developit","email":"jason@developit.ca"},"dist":{"integrity":"sha512-v0+rd8BpBo50OYZxeMzxqbb2BjwcH9AgdMB2CLEtCDwMwG3luGyhbfWL3bUvJBttgsjHjrnqjt/ZU900iAoJxA==","shasum":"2ad087781f80577f61cc0eed62c5d8a8210d811b","tarball":"https://registry.npmjs.org/prerender-loader/-/prerender-loader-1.1.0.tgz","fileCount":29,"unpackedSize":79991,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbjvD0CRA9TVsSAnZWagAAsE4P/0rU2vQT9BUzy1ckxgqy\nKOiJWtm4hBPXp+fkHWd/MvaztxSnwBZ4+UenMHvARXeLJOI8SS4FuonCmcgr\nArL3ZwbEP1wGlA7berIXvNJmrVREO0kci+Ek7YOaCMmZaXaaoKSSJFZlbIZ1\nB7GbEaEOnO4VBecXyzeO84GTwE/WwaIZl+5QQQjFMvdGt5WD8gK1atHO6m/j\np0IzsNHjpj4YVZxhRSmOtT5/Qr54SbPMU+52sCLvdh5SMpXTWwOJM9eismTx\ns899MkbXhLXZvisb/pqvcmCW2gGkKSSoTNvnHq2g9vy09wPS7ys+XJdLsX5r\nldzxFEcyz/vns+oce8ygh2xy50tfCIw/Hr/eEsUNHN/OlGeVFbvdvR1U5Z73\nMy5btolQOZXFVzlU2YgLMtG/oVCDYybNYpLqKkX7WTF/MdlvpKIl8rMaqxpV\ng3tQZ4TAZ36/ZuFq87BkBz8SguMxApYNciHP1P495zzLAQMpAC2mJ7JA3PG+\n6BqU+nt1VNMwgdCT2ONw8vyociFG1bh7Hcr8HjI+aNCUR4hkIbri31972ZQz\nYZuoyPJqtzfEA2PM2QJG9ifvGPuSicUYsrzAa5+WwCEirp5gB/7m8nYlB6iF\n1gZujxZv315rktdCAp+vmT9o1aH1muJmTXsqAf4bO7oK2BPXKJhBra9z6zbe\n/Qml\r\n=DuHt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFx6eMR5R7CZWpfG1C5G5GNiEz4OlrbQTjUKGeYPl5fWAiEA/yzUHzg9m71P6h7TfVKAvp2W6lZwuQmg32zDLZBXsno="}]},"maintainers":[{"name":"developit","email":"jason@developit.ca"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/prerender-loader_1.1.0_1536094452211_0.2837325910426993"},"_hasShrinkwrap":false},"1.2.0":{"name":"prerender-loader","version":"1.2.0","description":"Painless universal prerendering for Webpack. Works great with html-webpack-plugin.","main":"dist/prerender-loader.js","source":"src/index.js","license":"Apache-2.0","author":{"name":"The Chromium Authors"},"contributors":[{"name":"Jason Miller","email":"developit@google.com"}],"keywords":["pre-render","prerendering","webpack plugin","SSR","performance","first contentful paint","FCP"],"repository":{"type":"git","url":"git+https://github.com/GoogleChromeLabs/prerender-loader.git"},"scripts":{"build":"microbundle -f cjs --no-compress --external all","docs":"documentation readme -q --no-markdown-toc -a public -s Usage --sort-order alpha src","test":"jest --coverage","prepare":"npm run -s build","release":"npm run build -s && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish"},"babel":{"presets":["env"]},"jest":{"testEnvironment":"node","coverageReporters":["text"],"collectCoverageFrom":["src/**/*"],"watchPathIgnorePatterns":["node_modules","dist"]},"devDependencies":{"babel-core":"^6.26.3","babel-jest":"^23.0.0","babel-preset-env":"^1.7.0","documentation":"^7.0.0","eslint":"^4.19.1","eslint-config-standard":"^11.0.0","eslint-plugin-import":"^2.12.0","eslint-plugin-jest":"^21.15.2","eslint-plugin-node":"^6.0.1","eslint-plugin-promise":"^3.8.0","eslint-plugin-standard":"^3.1.0","file-loader":"^1.1.11","html-webpack-plugin":"^3.2.0","jest":"^23.0.0","memory-fs":"^0.4.1","microbundle":"^0.4.4","raw-loader":"^0.5.1","webpack":"^4.8.3"},"dependencies":{"jsdom":"^11.11.0","loader-utils":"^1.1.0"},"peerDependencies":{"webpack":"*","memory-fs":"*"},"eslintConfig":{"extends":["standard","plugin:jest/recommended"],"env":{"browser":false,"node":true},"rules":{"indent":[2,2],"semi":[2,"always"],"prefer-const":1}},"gitHead":"317993c3d91de937387afc19e8d13cca33539119","bugs":{"url":"https://github.com/GoogleChromeLabs/prerender-loader/issues"},"homepage":"https://github.com/GoogleChromeLabs/prerender-loader#readme","_id":"prerender-loader@1.2.0","_npmVersion":"6.4.1","_nodeVersion":"10.9.0","_npmUser":{"name":"developit","email":"jason@developit.ca"},"dist":{"integrity":"sha512-SwDsS/mvPSwRVxo6OhFnsZ9lm47FkXIuFMm1oAUQyD9Yrc4+uq6z194mUzTveuye6RwUQ2XH2xFHF4cA3R36Gw==","shasum":"befbffc392e6080a79fe8d40af8dc33c000bbb6e","tarball":"https://registry.npmjs.org/prerender-loader/-/prerender-loader-1.2.0.tgz","fileCount":29,"unpackedSize":84574,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb2TCbCRA9TVsSAnZWagAAdFsP/1Zw5Kfb5Nt5yxQ75Uci\ndViZ4L3MsAGFBOZvMbNhGDKBgqwwkdEqCU474cKqn9H6dmzz/zZIH+zRY3ma\nv/R2QjNN6QGgs62nERuYhGlDJj9AcQqzsiaBHDG74cA9t6/WfwvF14EK2dbl\nKHj9Gvz44ZAxsHtLS37xKgBa9YSfsdh+9Iaam+vIaV1/TJCcxY0+7bjb4qVE\nFRuwguaPDJ7rEaJfdAUOuy9gLazVSSYD9ZSe9CgJhNGHZ9vdSR6vM5iTj/jr\nPqIJUZgNhsUNCKMqvqfSr0ByzFomgc9f9o/LXxBdFpJSDaI2XYDQODuJA100\nnXSxkEip61WGp8Yn+MI+tqAQby+lOIHEtTCYTjjmIVxfwImJzaTGEFUG3w6I\nCYd6u+KZIRNn/bpkW3e5xf5735pHEWVA8I/5PGxS1pwzEZHlEtTsvKphNGpM\ncGKMNwchDMgv0CuOytkXuzSI4osRuwCpuyVqe8HV/ALsKhhN6/txsbLElwkz\nNJYEjED2iicsUd1tYZxKvOxOK3HVLeYcJdnRNIXxUrdfWBdbDLFv3SaDq1nG\nfcYdgnH6jV7279U+dICRb9CE2cxqJXER6/+VXuPvHBOBay3bm5+okCtOcVxl\n5a7lM6qC3i+Jf3BaREYsTWIDwewtIuBcS7rS6Gbizt4NSKO86aZZGkBSgKhq\nb9zt\r\n=rLK9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCaCaAz0QsuaVVqNU95Qptv0L88f8lMRvTkccx/gPmQIwIhAKGOI8VxAEGqdegjuOaFDoT0V8nl6A32jD292A2Cu8Wu"}]},"maintainers":[{"name":"developit","email":"jason@developit.ca"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/prerender-loader_1.2.0_1540960410891_0.5006306284977378"},"_hasShrinkwrap":false},"1.3.0":{"name":"prerender-loader","version":"1.3.0","description":"Painless universal prerendering for Webpack. Works great with html-webpack-plugin.","main":"dist/prerender-loader.js","source":"src/index.js","license":"Apache-2.0","author":{"name":"The Chromium Authors"},"contributors":[{"name":"Jason Miller","email":"developit@google.com"}],"keywords":["pre-render","prerendering","webpack plugin","SSR","performance","first contentful paint","FCP"],"repository":{"type":"git","url":"git+https://github.com/GoogleChromeLabs/prerender-loader.git"},"scripts":{"build":"microbundle -f cjs --no-compress --external all","docs":"documentation readme -q --no-markdown-toc -a public -s Usage --sort-order alpha src","test":"jest --coverage","prepare":"npm run -s build","release":"npm run build -s && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish"},"babel":{"presets":["env"]},"jest":{"testEnvironment":"node","coverageReporters":["text"],"collectCoverageFrom":["src/**/*"],"watchPathIgnorePatterns":["node_modules","dist"]},"devDependencies":{"babel-core":"^6.26.3","babel-jest":"^23.0.0","babel-preset-env":"^1.7.0","documentation":"^7.0.0","eslint":"^4.19.1","eslint-config-standard":"^11.0.0","eslint-plugin-import":"^2.12.0","eslint-plugin-jest":"^21.15.2","eslint-plugin-node":"^6.0.1","eslint-plugin-promise":"^3.8.0","eslint-plugin-standard":"^3.1.0","file-loader":"^1.1.11","html-webpack-plugin":"^3.2.0","jest":"^23.0.0","memory-fs":"^0.4.1","microbundle":"^0.4.4","raw-loader":"^0.5.1","webpack":"^4.8.3"},"dependencies":{"jsdom":"^11.11.0","loader-utils":"^1.1.0"},"peerDependencies":{"webpack":"*","memory-fs":"*"},"eslintConfig":{"extends":["standard","plugin:jest/recommended"],"env":{"browser":false,"node":true},"rules":{"indent":[2,2],"semi":[2,"always"],"prefer-const":1}},"gitHead":"f53edabd0bb580171ff8e86c80233e8b2ecda263","bugs":{"url":"https://github.com/GoogleChromeLabs/prerender-loader/issues"},"homepage":"https://github.com/GoogleChromeLabs/prerender-loader#readme","_id":"prerender-loader@1.3.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.0","_npmUser":{"name":"developit","email":"jason@developit.ca"},"dist":{"integrity":"sha512-j5a7vl7QjLiNL2+7ATHiTHIcV18xf8hDJUbkl66svHfuCMd7QV/0Iwu1Yp8JcRNt7UEKSxgJQ35WZSOaRCQhZQ==","shasum":"524c386c16579270109f277f7e1a94df298c8a9e","tarball":"https://registry.npmjs.org/prerender-loader/-/prerender-loader-1.3.0.tgz","fileCount":30,"unpackedSize":85204,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJccBLXCRA9TVsSAnZWagAAV/8P/jGOsMDPm+Yid6uwGn2j\ngyWDrrkjKWgMpDlBkrgLrCxAiX4hWbTohWqvKbxJJak2gSv8vnR+HDVEcq00\nfRLDF6JuaXknwNbN3GJIGCR7LNPWyMMPMILLsyKCkgStw6Oy/p871RWX/hpA\npoOnf0/QEiXcxBHvhQbw56H/z07zNBXNQ7/0Mus26/9NtBpGTWBXb8G/nBSh\nPrZBKzPZgsrlDd90MZNKZsBOGODx1aq1U8OdH+22NQRmuldEjNUaVP/i/U+b\nrgWfPMGta38my4RLj8USBVZ2dI4cU8ntCkNuvt8uco1gQmk5jDQLIr8cMmT7\nakeFG6TEPHcILaBspUdyohUowKLRZ21wF2ps0nhVbvdxfJR9GidAbpMkyJ9Q\nnO8pCEnCR/PQxbuIBPChdUBC+ytVeLsyr2BWjH1EPXaotInBFbWuut1E86hS\nNQyp61miJtdnMUJeIlu16rMgXyAKu4sjCwKl66jBS0icPqCyh/af6XpNOt6v\nT6CqPnbt2Uzz089ChqMR67FltOJEiVDutW8m4WvqUuzeOQke9AL2NyBRA9fC\nUKQb3qD9UVhDRZ8h8SEhwMMVfHIh2kRYN7dX6WVWAvrMBvAsY+WgQhuwu+NT\nDJF6Q5IDFUtrmkpZVQs+qU70A1fR2w/H1kdOcDchbj3GfnsSCD9zFtJaFLFM\n9mUg\r\n=T4lz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAxdXuy4I6HR2SMSzzKhrA312XFm3UWdNz6rb7nr0XHcAiEAgw/7TfluZxhLMApxyeMTLf8swQEW2x7ALhRq/VH5TaE="}]},"maintainers":[{"name":"developit","email":"jason@developit.ca"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/prerender-loader_1.3.0_1550848726994_0.2877441213608274"},"_hasShrinkwrap":false}},"time":{"created":"2018-05-30T17:59:27.996Z","1.0.0":"2018-05-30T17:59:28.098Z","modified":"2022-05-13T09:04:25.196Z","1.1.0":"2018-09-04T20:54:12.304Z","1.2.0":"2018-10-31T04:33:31.019Z","1.3.0":"2019-02-22T15:18:47.129Z"},"maintainers":[{"email":"paul.kinlan@gmail.com","name":"kinlan"},{"email":"jason@developit.ca","name":"developit"}],"description":"Painless universal prerendering for Webpack. Works great with html-webpack-plugin.","homepage":"https://github.com/GoogleChromeLabs/prerender-loader#readme","keywords":["pre-render","prerendering","webpack plugin","SSR","performance","first contentful paint","FCP"],"repository":{"type":"git","url":"git+https://github.com/GoogleChromeLabs/prerender-loader.git"},"contributors":[{"name":"Jason Miller","email":"developit@google.com"}],"author":{"name":"The Chromium Authors"},"bugs":{"url":"https://github.com/GoogleChromeLabs/prerender-loader/issues"},"license":"Apache-2.0","readme":"<p align=\"center\">\n  <img src=\"https://i.imgur.com/BL0lf5F.png\" width=\"240\" height=\"240\" alt=\"prerender-loader\">\n  <h1 align=\"center\">\n    prerender-loader\n    <a href=\"https://www.npmjs.org/package/prerender-loader\"><img src=\"https://img.shields.io/npm/v/prerender-loader.svg?style=flat\" alt=\"npm\"></a>\n  </h1>\n</p>\n\nPainless universal prerendering for Webpack. Works great with\n[html-webpack-plugin].\n\n> 🧐 **What is Prerendering?**\n>\n>Pre-rendering describes the process of rendering a client-side application at\n>build time, producing useful static HTML that can be sent to the browser\n>instead of an empty bootstrapping page.\n>\n>Pre-rendering is like Server-Side Rendering, just done at build time to produce\n>static files. Both techniques help get meaningful content onto the user's\n>screen faster.\n\n## Features\n\n-   Works entirely within Webpack\n-   Integrates with [html-webpack-plugin]\n-   Works with `webpack-dev-server` / `webpack serve`\n-   Supports both DOM and String prerendering\n-   Asynchronous rendering via async/await or Promises\n\n---\n\n<!-- TOC depthFrom:2 -->\n\n- [Features](#features)\n- [How does it work?](#how-does-it-work)\n- [Installation](#installation)\n- [Usage](#usage)\n  - [DOM Prerendering](#dom-prerendering)\n  - [String Prerendering](#string-prerendering)\n  - [Injecting content into the HTML](#injecting-content-into-the-html)\n  - [Prerendering JavaScript Files](#prerendering-javascript-files)\n- [Options](#options)\n- [License](#license)\n\n<!-- /TOC -->\n\n## How does it work?\n\n`prerender-loader` renders your web application within Webpack during builds,\nproducing static HTML. When the loader is applied to an HTML file, it creates a\nDOM structure from that HTML, compiles the application, runs it within the DOM\nand serializes the result back to HTML.\n\n---\n\n## Installation\n\nFirst, install `prerender-loader` as a development dependency:\n\n```sh\nnpm i -D prerender-loader\n```\n\n---\n\n## Usage\n\nIn most cases, you'll want to apply the loader to your `html-webpack-plugin`\ntemplate option:\n\n```diff\n// webpack.config.js\nmodule.exports = {\n  plugins: [\n    new HtmlWebpackPlugin({\n-     template: 'index.html',\n+     template: '!!prerender-loader?string!index.html',\n\n      // any other options you'd normally set are still supported:\n      compile: false,\n      inject: true\n    })\n  ]\n}\n```\n\nWhat does all that punctuation mean? Let's break the whole loader string\ndown:\n\n> In Webpack, a module identifier beginning with `!!` will bypass any configured\n>loaders from `module.rules` - here we're saying \"don't do anything to\n>`index.html` except what I've defined here\n>\n>The `?string` parameter tells `prerender-loader` to output an ES module\n>exporting the prerendered HTML string, rather than returning the HTML directly.\n>\n>Finally, everything up to the last `!` in a module identifier is the inline\n>loader definition (the transforms to apply to a given module).  The filename of\n>the module to load comes after the `!`.\n>\n>**Note:** If you've already set up `html-loader` or `raw-loader` to handle\n>`.html` files, you can skip both options and simply pass a `template` value of\n>`\"prerender-loader!index.html\"`!\n\nAs with any loader, it is also possible to apply `prerender-loader` on-the-fly\n:\n\n```js\nconst html = require('prerender-loader?!./app.html');\n```\n\n... or in your Webpack configuration's `module.rules` section:\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: 'src/index.html',\n        loader: 'prerender-loader?string'\n      }\n    ]\n  }\n}\n```\n\n\nOnce you have `prerender-loader` in-place, prerendering is now turned on. During\nyour build, the app will be executed, with any modifications it makes to\n`index.html` will be saved to disk.  This is fine for the needs of many apps,\nbut you can also take more explicit control over your prerendering: either using\nthe DOM or by rendering to a String.\n\n### DOM Prerendering\n\nDuring prerendering, your application gets compiled and run directly under\nNodeJS, but within a [JSDOM] container so that you can use the familiar browser\nglobals like `document` and `window`.\n\nHere's an example `entry` module that uses DOM prerendering:\n\n```js\nimport { render } from 'fancy-dom-library';\nimport App from './app';\n\nexport default () => {\n  render(<App />, document.body);\n};\n```\n\nIn all cases, asynchronous functions and callbacks are supported:\n\n```js\nimport { mount } from 'other-fancy-library';\nimport app from './app';\n\nexport default async function prerender() {\n  let res = await fetch('https://example.com');\n  let data = await res.json();\n  mount(app(data), document.getElementById('app'));\n}\n```\n\n### String Prerendering\n\nIt's also possible to export a function from your Webpack entry module, which\ngives you full control over prerendering: `prerender-loader` will call the\nfunction and its return value will be used as the static HTML.  If the exported\nfunction returns a Promise, it will be awaited and the resolved value will be\nused.\n\n```js\nimport { renderToString } from 'react-dom';\nimport App from './app';\n\nexport default () => {\n  const html = renderToString(<App />);\n  // returned HTML will be injected into <body>:\n  return html;\n};\n```\n\nIn addition to DOM and String prerendering, it's also possible to use a\ncombination of the two.  If an application's Webpack entry exports a prerender\nfunction that doesn't return a value, the default DOM serialization will kick\nin, just like in DOM prerendering. This means you can use your exported\nprerender function to trigger DOM manipulation (\"client-side\" rendering), and\nthen just let `prerender-loader` handle generating the static HTML for whatever\ngot rendered.\n\nHere's an example that renders a [Preact] application and waits for DOM\nrendering to settle down before allowing prerender-loader to serialize the\ndocument to static HTML:\n\n```js\nimport { h, options } from 'preact';\nimport { renderToString } from 'preact';\nimport App from './app';\n\n// we're done when there are no renders for 50ms:\nconst IDLE_TIMEOUT = 50;\n\nexport default () => new Promise(resolve => {\n  let timer;\n  // each time preact re-renders, reset our idle timer:\n  options.debounceRendering = commit => {\n    clearTimeout(timer);\n    timer = setTimeout(resolve, IDLE_TIMEOUT);\n    commit();\n  };\n\n  // render into <body> using normal client-side rendering:\n  render(<App />, document.body);\n});\n```\n\n### Injecting content into the HTML\n\nWhen applied to a `.html` file, `prerender-loader` will inject prerendered\ncontent at the end of `<body>` by default.  If you want to place the content\nsomewhere else, you can add a `{{prerender}}` field:\n\n```html\n<html>\n  <body>\n    <div id=\"app_root\">\n      <!-- Inject any pre-rendered HTML here: -->\n      {{prerender}}\n    </div>\n  </body>\n</html>\n```\n\nThis works well if you intend to provide a prerender function that only returns\nyour application's HTML structure, not the full document's HTML.\n\n### Prerendering JavaScript Files\n\nIn addition to processing `.html` files, the loader can also directly pre-render\n`.js` scripts. The only difference is that the DOM used for prerender will be\ninitially empty:\n\n```js\nconst prerenderedHtml = require('!prerender-loader?string!./app.js');\n```\n\n---\n\n## Options\n\nAll options are ... optional.\n\n| Option        | Type    | Default            | Description                                                            |\n| ------------- | ------- | ------------------ | ---------------------------------------------------------------------- |\n| `string`      | boolean | false              | Output a JS module exporting an HTML String instead of the HTML itself |\n| `disabled`    | boolean | false              | Bypass the loader entirely (but still respect `options.string`)        |\n| `documentUrl` | string  | 'http://localhost' | Change the jsdom's URL (affects `window.location`, `document.URL`...)  |\n| `params`      | object  | null               | Options to pass to your prerender function                             |\n\n\n---\n\n## License\n\n[Apache 2.0](LICENSE)\n\nThis is not an official Google product.\n\n[html-webpack-plugin]: https://github.com/jantimon/html-webpack-plugin\n[JSDOM]: https://github.com/jsdom/jsdom\n[Preact]: https://preactjs.com\n","readmeFilename":"README.md"}