2.0.0 • Published 2 years ago

spank v2.0.0

Weekly downloads
642
License
MIT
Repository
github
Last release
2 years ago

Export HTML pages from your SPA

Usage

//spank.config.js
module.exports = {
  sitemap: 'path/to/a-list-of-urls.json',
  entrypoint: 'dist/__index.html',
  script: 'dist/main.js',
  outputDir: 'dist'
}

open terminal and type

npx spank
Note

spank can also be used without a config. Use npx spank --help for parameters.


Config options

propdefaultdescription
sitemap.js or .json file with a list of relative paths. Eg. ['/', '/about', '/contact']
entrypointdist/__app.htmlpath to the HTML template to render the SPA in. Often static/index.html
scriptdist/build/bundle.jsPath to the app script. Often dist/build/bundle.js or dist/build/main.js
outputDirdistFolder to save HTML files to.
forceIndexfalseWrite /about to about/index.html instead of about.html
inlineDynamicImportsfalseRequired if app uses dynamic imports
concurrently3Max simultaneous running jobs
eventNameIf specified, HTMLs aren't saved till the page has emitted the event.
hosthttp://jsdom.ssrSimulated host

How does it work?

For each path in the sitemap, Spank creates a corresponding SPA in a simulated browser. The HTML for each page is then saved to the output folder.


2.0.0

2 years ago

2.0.0-14

3 years ago

2.0.0-13

3 years ago

2.0.0-12

3 years ago

2.0.0-11

3 years ago

2.0.0-10

3 years ago

2.0.0-6

3 years ago

2.0.0-5

3 years ago

2.0.0-4

3 years ago

2.0.0-3

3 years ago

2.0.0-2

3 years ago

2.0.0-1

3 years ago

2.0.0-0

3 years ago

2.0.0-9

3 years ago

2.0.0-8

3 years ago

2.0.0-7

3 years ago

1.9.0

4 years ago

1.8.0

4 years ago

1.7.1

4 years ago

1.7.1-0

4 years ago

1.7.0

4 years ago

1.6.1

4 years ago

1.6.0

4 years ago

1.5.3

4 years ago

1.5.2

4 years ago

1.5.1

4 years ago

1.5.0

4 years ago

1.5.0-0

5 years ago

1.4.0

5 years ago

1.3.3

5 years ago

1.3.2

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.0

5 years ago

1.2.0-0

5 years ago

1.1.0

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago