Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vivshaw/marotte
A CLI utility to statically prerender your dynamic front-end apps, using Puppeteer & Express
https://github.com/vivshaw/marotte
express pre-rendering puppeteer static typescript
Last synced: 4 days ago
JSON representation
A CLI utility to statically prerender your dynamic front-end apps, using Puppeteer & Express
- Host: GitHub
- URL: https://github.com/vivshaw/marotte
- Owner: vivshaw
- License: mit
- Created: 2018-08-22T04:30:54.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-12-09T07:32:08.000Z (almost 4 years ago)
- Last Synced: 2024-04-29T05:20:19.792Z (7 months ago)
- Topics: express, pre-rendering, puppeteer, static, typescript
- Language: TypeScript
- Size: 81.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# marotte
#### A CLI utility to statically prerender your dynamic front-end apps, using Puppeteer & Express
#### This was a learning project- please don't use it for production applications!![Splash](https://i.imgur.com/iMDz6PO.png)
Borne out of annoyance with the overkill of using full SSR for small projects, and the difficulty of getting framework-specific static prerendering tools working the way I wanted, marotte is a Puppeteer-based, framework-agnostic CLI app to statically prerender a front-end app. Since it's a CLI app, one can easily add 'marotte render' to their npm build script & have it run whenever you build.
## Usage
Global install:
```
npm i -g marotte
marotte init
marotte render
```Local install:
```
npm i -D marotte
{add marotte to your build scripts}
```## Commands
### render
This command statically prerenders your application by firing up an Express instance to host it, crawling it with Puppeteer, and writing the html content of the pages it finds to disk at the appropriate path.```
> marotte render --helpUsage: render|r [options]
Statically prerender the application
Options:
-w, --workingdir [dir] Working directory for project [processs.cwd()]
-d, --dist [dir] Distribution subdirectory for project [./dist]
-p, --port [port] Port to host Express on [4000]
-h, --help output usage information
```### init
This command will walk you through setting up a config file.