{"_id":"@asyarb/vite-plugin-ssr-nojs","_rev":"2-924ab2b76da028b79608a1adaae7a80c","name":"@asyarb/vite-plugin-ssr-nojs","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.1":{"name":"@asyarb/vite-plugin-ssr-nojs","license":"MIT","description":"Vite plugin for authoring static HTML with your favorite JS libraries and frameworks.","author":{"name":"Anthony Yarbrough","email":"asyarb"},"version":"0.1.1","main":"dist/index.js","scripts":{"prebuild":"rimraf dist","build":"esbuild src/index.ts --bundle --platform=node --target=node15 --external:fs --external:path --external:vite --outfile=dist/index.js","postbuild":"tsc --emitDeclarationOnly --outDir dist","dev":"yarn build --watch","prepare":"yarn build","release":"standard-version"},"dependencies":{"node-html-parser":"^3.1.3"},"peerDependencies":{"vite":"^2.1.5"},"devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@types/node":"^14.14.37","esbuild":"^0.11.7","husky":"^6.0.0","prettier":"^2.2.1","rimraf":"^3.0.2","standard-version":"^9.2.0","typescript":"^4.2.4","vite":"^2.1.5"},"prettier":{"printWidth":80,"singleQuote":true,"semi":false,"proseWrap":"always"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS"}},"commitlint":{"extends":["@commitlint/config-conventional"]},"licenseText":"Copyright 2021 Anthony Yarbrough\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","_id":"@asyarb/vite-plugin-ssr-nojs@0.1.1","dist":{"shasum":"64977fe3ed77df9f298f274cf02e5b02263d1c6f","integrity":"sha512-pNL0kLNT1KiHq6Dj+kswr5KPviuQ0jNJbkE8cVBACOOmHhGzDjm7quHMxp46keUDYZV8F9DuhIJYNkHiH7QDyg==","tarball":"https://registry.npmjs.org/@asyarb/vite-plugin-ssr-nojs/-/vite-plugin-ssr-nojs-0.1.1.tgz","fileCount":8,"unpackedSize":281327,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgci/wCRA9TVsSAnZWagAAtpsQAIWYk4X6ZrLaMEaEpjzJ\nQy6AA1IYCpJGUsdRRNjvFPVHuhr+0u/O/1ZTy6ou2ttwg5V8pF8TnbxJ4rGI\nzJ0ykA1cJYlYtPTA6PZgx2NnpdjQtQswr3RwO2ceE4RpRBq16OC2vwzJMgxe\nMbtmAwiDEGXvU15vC8LV6SCZ3j9hEwMkk8K+EHH3O1lbbpwzlv0VfRS8WulV\nEvd/8WaydQWqD+uh5ipYMVApVKnT+nEP0uL9//OSFZt7G5b81WDUHVDhVNG8\nbwfZaF2Nu6DttrZn5OtEk+a00cmnfA/Xlz2OSwJkVSjT4R1yR4nZh/37siKn\nUe5hVGTQ47a7FVZo0wCvAJL5mQSPHXZu9AGEcvd3ZGnPaJQvAJMTeqz60WoT\nIL6lG80V9GX5fIB9+MSuUDMz47MTa8gPXhHj3u1U49+rsz3rk+1TZ4viMQYr\nUm6ys52iM/2NaOnIIjb8gtHVauF19VodLGWzXOjXVWHJpaEtYlg1os/G+wgA\nxdQs3s5Cd/H6uOy4RiqoktdxnYfaDbE1XuuYD989lYwarVgYwF5h087+aSsT\nzla1GSAqODgNt8eVO4BctdJDdESVYwsueA3GOJ5N4P+URienJ1nRg4bG9GCm\nmIMOzsk8sECfHlVX01wX+wQK2jGPRwAIASxSbmDlzYL1bLytbEIahBt8A1N1\nvFGq\r\n=Phpc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDEo5g4HgbybQwG28Dv0+uGuHDrQTGfeUhP1IyB4avzLgIhAJTBxntQa3JTKdEdlClTRbBAkhcT987G+58fXre9phLi"}]},"_npmUser":{"name":"asyarb","email":"asyarb@hawaii.edu"},"directories":{},"maintainers":[{"name":"asyarb","email":"asyarb@hawaii.edu"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vite-plugin-ssr-nojs_0.1.1_1618096111815_0.5588164436909502"},"_hasShrinkwrap":false},"0.1.2":{"name":"@asyarb/vite-plugin-ssr-nojs","license":"MIT","description":"Vite plugin for authoring static HTML with your favorite JS libraries and frameworks.","author":{"name":"Anthony Yarbrough","email":"asyarb"},"repository":{"type":"git","url":"https://github.com/asyarb/vite-plugin-ssr-nojs"},"version":"0.1.2","main":"dist/index.js","scripts":{"prebuild":"rimraf dist","build":"esbuild src/index.ts --bundle --platform=node --target=node15 --external:fs --external:path --external:vite --outfile=dist/index.js","postbuild":"tsc --emitDeclarationOnly --outDir dist","dev":"yarn build --watch","prepare":"yarn build","release":"standard-version"},"dependencies":{"node-html-parser":"^3.1.3"},"peerDependencies":{"vite":"^2.1.5"},"devDependencies":{"@commitlint/cli":"^12.1.1","@commitlint/config-conventional":"^12.1.1","@types/node":"^14.14.37","esbuild":"^0.11.7","husky":"^6.0.0","prettier":"^2.2.1","rimraf":"^3.0.2","standard-version":"^9.2.0","typescript":"^4.2.4","vite":"^2.1.5"},"prettier":{"printWidth":80,"singleQuote":true,"semi":false,"proseWrap":"always"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS"}},"commitlint":{"extends":["@commitlint/config-conventional"]},"licenseText":"Copyright 2021 Anthony Yarbrough\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","_id":"@asyarb/vite-plugin-ssr-nojs@0.1.2","dist":{"shasum":"15c2f44ebef5c174a8711bee976ebe367892b3cf","integrity":"sha512-B2CEALYyC+cmU4Qvl0bf9vS/bN2G4MlVQUabnQdNqCsdkIbZD8Jn4Ma6UzGEahnTvT8lD+bIkvcESlgG2o2DFQ==","tarball":"https://registry.npmjs.org/@asyarb/vite-plugin-ssr-nojs/-/vite-plugin-ssr-nojs-0.1.2.tgz","fileCount":8,"unpackedSize":281491,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgcjDBCRA9TVsSAnZWagAA52UP/jqVdU025pHGrgblJvM6\nqSdTAXL6rTUiZ9LsxR6z90lrsEaa9c1BOuena2rL3B7UiVw1os0XGIMDP0n7\nWJ12AtuhalG6v5SD/ffSgYpnaunW1goRSdJAK9Zgym5UiBmFHRcIrDB7l9oY\n09PRyslRGgpd+zrAdqu19sT+nkg/8NwXnFBTBepm7BVOAu5lspoLSavF108V\n4JOOHYCT1ghy6wRo7cTV+9OS9TKmI4yqAzykiZPRWU6a84orxrETCriUhFGW\n0YyNvw2Y2OAB6spyOXbPZk/D0NKWYI7BjV9V2xWhklxmuoKJEW7PajG7HWvp\nS0f2OfnFWrYrzkVsCpFhMr6HauSnx+a+lcmEM7HS+g8kDqmHj/N3AgSTosQc\n67hLMJvMEODXX9J8f+s6n9c4ur5pfw4Ps+NuDc4O50YZIa5P/GBM5Rk5VgwO\nidRfaPvAEEp65GFhEWvw+hKerqRAJKq3Tq/+ZiaofcrxPDGzQAKDl0go9bbo\nafqKjlFysjPaiQQo5XOrFKPhiT5BXI0M5OVuO7Ub4hO0ltwILVIyCwcGdmqJ\nrZAVhsNPX2ZXFOen5QLDp2ilSltSlLX+2f2LCUKzLRElU0zWB7ggQzloG4SI\n9vnU9PIZHRr39OgYCeRJk6rY+StuKDY1Y9HrgkAPx2yA4b5kS9viU7i7+il7\ncMGo\r\n=ZtsN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF3LCinbtZsvPQqR7NcOP1l0O6T8CzLsbXyeLez+4J1SAiBJlkpxVbRLmXS0wO/TDBiXZsUt+SNfIIu9YRv+gf1D0Q=="}]},"_npmUser":{"name":"asyarb","email":"asyarb@hawaii.edu"},"directories":{},"maintainers":[{"name":"asyarb","email":"asyarb@hawaii.edu"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vite-plugin-ssr-nojs_0.1.2_1618096321240_0.0766998734500628"},"_hasShrinkwrap":false}},"time":{"created":"2021-04-10T23:08:31.754Z","0.1.1":"2021-04-10T23:08:31.994Z","modified":"2022-04-04T16:00:51.405Z","0.1.2":"2021-04-10T23:12:01.384Z"},"maintainers":[{"name":"asyarb","email":"asyarb@hawaii.edu"}],"description":"Vite plugin for authoring static HTML with your favorite JS libraries and frameworks.","author":{"name":"Anthony Yarbrough","email":"asyarb"},"license":"MIT","readme":"# Vite Plugin SSR No JS\n\nA simple Vite plugin to use your preferred JS library as a templating language\nfor static HTML. This plugin will render your provided app as a series of\n`.html` files with no JavaScript included.\n\nThis plugin's purpose is to provide a modern DX (components, fast hot-reloading,\ncss/asset management, etc.) for authoring basic HTML files, and is not intended\nfor use in large production projects.\n\n## Installation\n\n```sh\n# yarn\nyarn add -D @asyarb/vite-plugin-ssr-nojs\n\n# npm\nnpm i -D @asyarb/vite-plugin-ssr-nojs\n```\n\n## Usage\n\n1. Add the plugin to your Vite config file. See comments for additional\n   information regarding options to pass the plugin.\n\n   ```ts\n   // vite.config.ts\n   import * as path from 'path'\n   import { defineConfig } from 'vite'\n   import reactRefresh from '@vitejs/plugin-react-refresh'\n   import { ssrNoJsPlugin } from '@asyarb/vite-plugin-ssr-nojs'\n\n   export default defineConfig({\n     plugins: [\n       reactRefresh(),\n       ssrNoJsPlugin({\n         // An absolute path to a file that renders your app in a server-side\n         // context (e.g. ReactDOMServer.renderToStaticMarkup)\n         renderModulePath: path.resolve(__dirname, 'src/entry-server.tsx'),\n\n         // An absolute path to the output directory of your vite builds.\n         viteOutputPath: path.resolve(__dirname, 'dist'),\n\n         // A list of routes to statically render. Can be a static array or a\n         // function that returns an array of routes.\n         routes: ['/', '/about'], // routes: async () => ['/', '/about']\n\n         // A static string that will be used as the injection point for your\n         // server-rendered HTML. Default: `<!--ssr-html-->`.\n         htmlInjectionString: '<!--ssr-html-->',\n       }),\n     ],\n   })\n   ```\n\n2. Setup the file specified in `renderModulePath`. The example below uses React\n   and React Router, but any framework that can render to a string will work.\n\n   ```tsx\n   // src/entry-server.tsx\n   import * as React from 'react'\n   import * as ReactDOMServer from 'react-dom/server'\n   import { StaticRouter } from 'react-router-dom/server'\n\n   import { App } from './App'\n\n   // Your renderable module must export a function called `render` that\n   // receives the current `route` as a paramter.\n   export function render(route: string) {\n     return ReactDOMServer.renderToStaticMarkup(\n       <StaticRouter location={route}>\n         <App />\n       </StaticRouter>\n     )\n   }\n\n   // src/App.tsx\n   // Imports condensed for brevity.\n   export const App = () => {\n     return (\n       <Routes>\n         <Route path=\"/\" element={<HomePage />} />\n         <Route path=\"/about\" element={<AboutPage />} />\n       </Routes>\n     )\n   }\n   ```\n\n3. Add your `htmlInjectionString` to your `index.html` file. This will be\n   replaced with your app's SSR HTML at build time.\n\n   ```html\n   <!DOCTYPE html>\n   <html lang=\"en\">\n     <head>\n       <meta charset=\"UTF-8\" />\n       <link rel=\"icon\" type=\"image/svg+xml\" href=\"/src/assets/favicon.svg\" />\n       <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n       <title>Vite App</title>\n     </head>\n     <body>\n       <div id=\"app\"><!--ssr-html--></div>\n\n       <script type=\"module\" src=\"/src/main.tsx\"></script>\n     </body>\n   </html>\n   ```\n\n4. Run `vite build` and `vite dev` as you normally would. On builds, your\n   statically generated HTML files will be available in vite's output directory.\n\n## Limitations\n\nTODO, but here's the upshot:\n\n- JS is completely removed, so any runtime behavior in your app **will not\n  run**.\n\n## License\n\nMIT.\n","readmeFilename":"README.md","repository":{"type":"git","url":"https://github.com/asyarb/vite-plugin-ssr-nojs"}}