Since generated static sites need to run build scripts in a full-stack environment, they will consume project hours when the project editor is open and the project is actively being edited.
To prevent the live site from spending project hours when folks visit it, Glitch uses the following package.json property to make sure the output is detected as static:
This package.json property is included by default in our React and Eleventy generated static site starters.
If you are importing a generated static site via git or you are working on another type of generated static site that is not a remix of the Glitch or React starters, then you will need to add the “glitch” property shown above to your generated static site’s package.json.
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.
The Glitch generated static site starters 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 you are working on a generated static site that is not a remix of one of our starters, make sure that you have a folder named “build” where the generated content is being saved. Once you create the build folder, 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.