This is the property that enables Glitch In Bio, React and Eleventy to run the build scripts in a full-stack environment and then serve the output as a static site.
Since the output will be served as a static site, it won’t consume project hours when your users visit it. The only time your site will consume project hours is when you are working on it in the project editor.
If you are using the Glitch In Bio, Eleventy or React starter:
You will see the property by default in the package.json. Here’s what it looks like:
If you are working on a generated static site but you are not using one of the Glitch starters:
You can add the “glitch” property (as shown in the code snippet above) to the project’s package.json to prevent the live site from consuming project hours.
The “glitch” property is only needed for generated static sites.
When using this property, it should always be entered using the exact same parameters as shown in the code snippet above. If you change them, then the project editor will ignore it.
On Glitch, generated static sites are configured so that the site is served from the build folder. In the starter projects, you won’t see this folder because it is in .gitignore. If your project doesn’t already have it, you will need to create a folder named “build” and make sure that the generated content is being saved there. Then, you can add it to .gitignore to save disk space.
If you would like to learn more about package.json, check out this npm guide.