Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 

helmet-static

Create a static index.html for your sub pages with rendered helmet attributes

How

Add a helmet-static.js to your root, and at a minimum provide it the routes to process.

The default config is below and you can overide any of it by exporting it from your helmet-static.js file

{
    "basePath": "./dist",
    "rootDocument": "index.html",
    "port": 3001,
    "rootUrl": "http://localhost:${port}",
    "waitTime": 200,
    "navigationTimeout": 30000,
    "includeExternal": false,
    "allowedExternalDomains": [],
    "routes": ["/"],
    "headless": true
}

Example

Your build command will become

<your usual build commands> && helmet-static

If your config is

{
    "routes": ["/foo", "/bar", "/bar/stuff"]
}

You will end up with an output of

/dist
  --> /foo
    --> index.html
  --> /bar
    --> index.html
    --> /stuff
      --> index.html

About

Create a static index.html for your sub pages with rendered helmet attributes

Resources

License

Packages

No packages published