The configuration file is used to change the behaviour of the boilerplate. The config file used in this boilerplate belongs to PawJS Framework.
The default config for
pawconfig.json that we provide with this boilerplate is:
Define on which port you want to run the application.
Define the IP/hostname; you want to run your application on, without the schema. Example:
appRootUrl allows you to host your app in the subdirectories too.
Suppose your domain is
https://www.example.com/ and you want to host the app at
https://www.example.com/react-pwa/ then add
Loading assets from a CDN becomes easy. Just mention the
cdnUrl, and the app fetches the assets from the CDN.
NOTE: There are two types of CDN namely PULL and PUSH (more here) if you are using a PUSH CDN kindly push the assets to the CDN before deploying the app.
You can enable or disable Service-Worker by setting it to
NOTE: We highly discourage use of service-worker during development.
If you want to enable Server Side Rendering(SSR) then set value to
true or else set it as
Enabling SSR is beneficial for your site's performance and also makes it easy for search engines to crawl the content of your website to make it SEO friendly.
To load CSS asynchronously set the value to
true. Setting it as
false loads the CSS before the HTML loads.
You can change the Root Element ID where the react components render.
You can enable HSTS by setting the value of this variable to
true. Setting it to
false disables HSTS. Read more about HSTS here
This option lets you set the Max-Age of HSTS (in seconds).
true enables HSTS on all subdomains and directories.
HSTS preloading is browser's inbuilt function whereby a global list of hosts enfore their site to use HTTPS only.
Enabling it forces the user to access the site on
NOTE: If HSTS is disabled, setting other HSTS options will not affect the app.
Single Page Application (SPA)
Run & build the application as a Single Page Application. Uses HashRouter and is ideal for applications that does not require server support or SEO.