Skip to content
Create a static index.html for your sub pages with rendered helmet attributes
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
LICENSE
README.md
index.js
package-lock.json
package.json
server.js

README.md

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",
    "port": 3001,
    "waitTime": 200,
    "includeExternal": false,
    "routes": ["/"]
}

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
You can’t perform that action at this time.