2.0.0 • Published 1 year ago

spank v2.0.0

Weekly downloads
642
License
MIT
Repository
github
Last release
1 year 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

1 year ago

2.0.0-14

1 year ago

2.0.0-13

1 year ago

2.0.0-12

1 year ago

2.0.0-11

2 years ago

2.0.0-10

2 years ago

2.0.0-6

2 years ago

2.0.0-5

2 years ago

2.0.0-4

2 years ago

2.0.0-3

2 years ago

2.0.0-2

2 years ago

2.0.0-1

2 years ago

2.0.0-0

2 years ago

2.0.0-9

2 years ago

2.0.0-8

2 years ago

2.0.0-7

2 years ago

1.9.0

2 years ago

1.8.0

3 years ago

1.7.1

3 years ago

1.7.1-0

3 years ago

1.7.0

3 years ago

1.6.1

3 years ago

1.6.0

3 years ago

1.5.3

3 years ago

1.5.2

3 years ago

1.5.1

3 years ago

1.5.0

3 years ago

1.5.0-0

3 years ago

1.4.0

4 years ago

1.3.3

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.2.0-0

4 years ago

1.1.0

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago